Class CreationReference


  • public class CreationReference
    extends MethodReference
    Creation reference expression AST node type (added in JLS8 API).
     CreationReference:
         Type :: 
             [ < Type { , Type } > ]
             new
     
    Since:
    3.10
    Restriction:
    This class is not intended to be instantiated by clients.
    • Field Detail

      • TYPE_PROPERTY

        public static final ChildPropertyDescriptor TYPE_PROPERTY
        The "type" structural property of this node type (child type: Type).
      • TYPE_ARGUMENTS_PROPERTY

        public static final ChildListPropertyDescriptor TYPE_ARGUMENTS_PROPERTY
        The "typeArguments" structural property of this node type (element type: Type).
    • 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)
      • getType

        public Type getType()
        Returns the type of this creation reference expression.
        Returns:
        the type node
      • setType

        public void setType​(Type type)
        Sets the type of this creation reference expression.
        Parameters:
        type - the new type node
        Throws:
        IllegalArgumentException - if:
        • the node belongs to a different AST
        • the node already has a parent
      • typeArguments

        public List typeArguments()
        Returns the live ordered list of type arguments of this creation reference expression.
        Overrides:
        typeArguments in class MethodReference
        Returns:
        the live list of type arguments (element type: Type)