Klasse SingleMemberAnnotation

Alle implementierten Schnittstellen:
IExtendedModifier

public final class SingleMemberAnnotation extends Annotation
Single member annotation node (added in JLS3 API). The single member annotation "@foo(bar)" is equivalent to the normal annotation "@foo(value=bar)".
 SingleMemberAnnotation:
   @ TypeName ( Expression  )
 

Within annotations, only certain kinds of expressions are meaningful, including other annotations.

Seit:
3.1
  • Felddetails

    • TYPE_NAME_PROPERTY

      public static final ChildPropertyDescriptor TYPE_NAME_PROPERTY
      The "typeName" structural property of this node type (child type: Name).
    • VALUE_PROPERTY

      public static final ChildPropertyDescriptor VALUE_PROPERTY
      The "value" structural property of this node type (child type: Expression).
  • Methodendetails

    • propertyDescriptors

      public static List propertyDescriptors(int apiLevel)
      Returns a list of structural property descriptors for this node type. Clients must not modify the result.
      Parameter:
      apiLevel - the API level; one of the AST.JLS* constants
      Gibt zurück:
      a list of property descriptors (element type: StructuralPropertyDescriptor)
    • getValue

      public Expression getValue()
      Returns the value of this annotation.
      Gibt zurück:
      the value node
    • setValue

      public void setValue(Expression value)
      Sets the value of this annotation.
      Parameter:
      value - the new value
      Löst aus:
      IllegalArgumentException - if:
      • the node belongs to a different AST
      • the node already has a parent
      • a cycle in would be created