Class TypePattern


  • public class TypePattern
    extends Pattern
    TypePattern pattern AST node type.
     TypePattern:
          SingleVariableDeclaration
     
    Since:
    3.27
    Restriction:
    This class is not intended to be referenced by clients.
    Restriction:
    This class is not intended to be instantiated by clients.
    • 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)
        Restriction:
        This method is not intended to be referenced by clients.
      • propertyDescriptors

        public static List propertyDescriptors​(int apiLevel,
                                               boolean previewEnabled)
        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
        previewEnabled - the previewEnabled flag
        Returns:
        a list of property descriptors (element type: StructuralPropertyDescriptor)
        Restriction:
        This method is not intended to be referenced by clients.
      • setPatternVariable

        public void setPatternVariable​(SingleVariableDeclaration patternVariable)
        Sets the pattern variable.
        Parameters:
        patternVariable - the right operand node
        Throws:
        IllegalArgumentException - if:
        • the node belongs to a different AST
        • the node already has a parent
        • a cycle in would be created
        UnsupportedOperationException - if this operation is used other than JLS17
        UnsupportedOperationException - if this expression is used with previewEnabled flag as false
        Restriction:
        This method is not intended to be referenced by clients as it is a part of Java preview feature.
      • getPatternVariable

        public SingleVariableDeclaration getPatternVariable()
        Returns the pattern variable of Types Pattern.
        Returns:
        the pattern variable
        Throws:
        UnsupportedOperationException - if this operation is used other than JLS17
        UnsupportedOperationException - if this expression is used with previewEnabled flag as false
        Restriction:
        This method is not intended to be referenced by clients as it is a part of Java preview feature.