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 Detail

      • 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 Detail

      • 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