Klasse BreakStatement


public class BreakStatement extends Statement
Break statement AST node type.
 BreakStatement:
    break [ Identifier ] ;

    Break statement allows expression as part of Java 12 preview feature (JEP 325)
                break { Identifier | Expression }
 
Seit:
2.0
  • Felddetails

    • LABEL_PROPERTY

      public static final ChildPropertyDescriptor LABEL_PROPERTY
      The "label" structural property of this node type (child type: SimpleName).
      Seit:
      3.0
    • EXPRESSION_PROPERTY

      public static final ChildPropertyDescriptor EXPRESSION_PROPERTY
      Veraltet.
      The "expression" structural property of this node type (child type: Expression). (added in JEP 325).
      Seit:
      3.18
  • 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)
      Seit:
      3.0
    • propertyDescriptors

      public static List propertyDescriptors(int apiLevel, boolean previewEnabled)
      Veraltet.
      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
      previewEnabled - the previewEnabled flag
      Gibt zurück:
      a list of property descriptors (element type: StructuralPropertyDescriptor)
      Seit:
      3.20
    • getLabel

      public SimpleName getLabel()
      Returns the label of this break statement, or null if there is none.
      Gibt zurück:
      the label, or null if there is none
    • setLabel

      public void setLabel(SimpleName label)
      Sets or clears the label of this break statement.
      Parameter:
      label - the label, or null if there is none
      Löst aus:
      IllegalArgumentException - if:
      • the node belongs to a different AST
      • the node already has a parent
    • getExpression

      public Expression getExpression()
      Veraltet.
      Returns the expression of this break statement, or null if there is none.
      Gibt zurück:
      the expression, or null if there is none
      Löst aus:
      UnsupportedOperationException - if this operation is used other than JLS12
      Seit:
      3.18
    • setExpression

      public void setExpression(Expression expression)
      Veraltet.
      Sets or clears the expression of this break statement.
      Parameter:
      expression - the expression, or null if there is none
      Löst aus:
      IllegalArgumentException - if:
      • the node belongs to a different AST
      • the node already has a parent
      UnsupportedOperationException - if this operation is used other than JLS12
      Seit:
      3.18
    • isImplicit

      public boolean isImplicit()
      Veraltet.
      Gets the isImplicit of this break statement as true or false. true indicates implicit and false indicates not implicit.
      Gibt zurück:
      isImplicit true or false
      Löst aus:
      UnsupportedOperationException - if this operation is used other than JLS12
      Seit:
      3.18