Class RecordPattern


public class RecordPattern extends Pattern
TypePattern pattern AST node type.
 
 RecordPattern:
      Pattern<Pattern<Patterns....>> Type SimpleName
 
 
Since:
3.31
Restriction:
This class is not intended to be referenced by clients.
Restriction:
This class is not intended to be instantiated by clients.
  • Field Details

    • PATTERNS_PROPERTY

      public static final ChildListPropertyDescriptor PATTERNS_PROPERTY
      The "patterns" structural property of this node type (child type: Pattern).
    • PATTERN_TYPE_PROPERTY

      public static final ChildPropertyDescriptor PATTERN_TYPE_PROPERTY
      The "patternType" structural property of this node type (child type: Type).
  • 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)
      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.
    • setPatternType

      public void setPatternType(Type patternType)
      Sets the pattern type.
      Parameters:
      patternType - 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 JLS19
      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.
    • getPatternType

      public Type getPatternType()
      Returns the pattern type of Types Pattern.
      Returns:
      the pattern type
      Throws:
      UnsupportedOperationException - if this operation is used other than JLS19
      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.
    • patterns

      public List<Pattern> patterns()
      Returns the nested Pattern list.
      Returns:
      the live list of pattern nodes (element type: Pattern)
      Throws:
      UnsupportedOperationException - if this operation is used other than JLS19
      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.