Class 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 }
     
    Since:
    2.0
    Restriction:
    This class is not intended to be instantiated by clients.
    • Field Detail

      • EXPRESSION_PROPERTY

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

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

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

        public Expression getExpression()
        Returns the expression of this break statement, or null if there is none.
        Returns:
        the expression, or null if there is none
        Throws:
        UnsupportedOperationException - if this operation is used below JLS12
        Since:
        3.18
      • setExpression

        public void setExpression​(Expression expression)
        Sets or clears the expression of this break statement.
        Parameters:
        expression - the expression, or null if there is none
        Throws:
        IllegalArgumentException - if:
        • the node belongs to a different AST
        • the node already has a parent
        UnsupportedOperationException - if this operation is used below JLS12
        Since:
        3.18
      • isImplicit

        public boolean isImplicit()
        Gets the isImplicit of this break statement as true or false. true indicates implicit and false indicates not implicit.
        Returns:
        isImplicit true or false
        Throws:
        UnsupportedOperationException - if this operation is used below JLS12
        Since:
        3.18