Class VariableDeclarationFragment


public class VariableDeclarationFragment extends VariableDeclaration
Variable declaration fragment AST node type, used in field declarations, local variable declarations, ForStatement initializers, and LambdaExpression parameters. In contrast to SingleVariableDeclaration, fragments are missing the modifiers and the type; these are either located in the fragment's parent node, or inferred (for lambda parameters).
 VariableDeclarationFragment:
    Identifier { Dimension } [ = Expression ]
 
Since:
2.0
Restriction:
This class is not intended to be instantiated by clients.
  • Field Details

    • NAME_PROPERTY

      public static final ChildPropertyDescriptor NAME_PROPERTY
      The "name" structural property of this node type (child type: SimpleName).
      Since:
      3.0
    • EXTRA_DIMENSIONS_PROPERTY

      public static final SimplePropertyDescriptor EXTRA_DIMENSIONS_PROPERTY
      Deprecated.
      in JLS8 and later, use EXTRA_DIMENSIONS2_PROPERTY instead.
      The "extraDimensions" structural property of this node type (type: Integer) (below JLS8 only).
      Since:
      3.0
    • EXTRA_DIMENSIONS2_PROPERTY

      public static final ChildListPropertyDescriptor EXTRA_DIMENSIONS2_PROPERTY
      The "extraDimensions2" structural property of this node type (element type: Dimension) (added in JLS8 API).
      Since:
      3.10
    • INITIALIZER_PROPERTY

      public static final ChildPropertyDescriptor INITIALIZER_PROPERTY
      The "initializer" structural property of this node type (child type: Expression).
      Since:
      3.0
  • Method Details

    • propertyDescriptors

      public static List propertyDescriptors(int apiLevel)
      Returns a list of structural property descriptors for this node type. Clients must not modify the result.
      Parameters:
      apiLevel - the API level; one of the AST.JLS* constants
      Returns:
      a list of property descriptors (element type: StructuralPropertyDescriptor)
      Since:
      3.0