Class UnionType


  • public class UnionType
    extends Type
    Type node for an union type (added in JLS4 API).
     UnionType:
        Type | Type { | Type }
     

    This kind of node is used inside a catch clause's formal parameter type.

    Since:
    3.7.1
    Restriction:
    This class is not intended to be instantiated by clients.
    • Field Detail

    • 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)
      • types

        public List types()
        Returns the live ordered list of types in this union type. Adding and removing nodes from this list affects this node dynamically. All nodes in this list must be Types; attempts to add any other type of node will trigger an exception.
        Returns:
        the live list of types in this union type (element type: Type)