Class YieldStatement


  • public class YieldStatement
    extends Statement
    Yield statement AST node type.
     YieldStatement:
                    Yield { Identifier/Expression }
     
    Since:
    3.22
    • Field Detail

      • EXPRESSION_PROPERTY

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

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

        public void setExpression​(Expression expression)
        Sets or clears the expression of this Yield statement.
        Parameters:
        expression - the expression
        Throws:
        IllegalArgumentException - if:
        • the node belongs to a different AST
        • the node already has a parent
        UnsupportedOperationException - if this operation is used below JLS14
        Since:
        3.22
      • 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 JLS14
        Since:
        3.22