Class NameQualifiedType


  • public class NameQualifiedType
    extends AnnotatableType
    Node for a name-qualified type (added in JLS8 API).
     NameQualifiedType:
        Name . { Annotation } SimpleName
     

    The qualifier can resolve to a type or to a package.

    Note that if no annotation is present, then a name-qualified type can also be represented by a SimpleType or a QualifiedType, see the discussion in QualifiedType.

    Since:
    3.10
    See Also:
    SimpleType, QualifiedType
    Restriction:
    This class is not intended to be instantiated by clients.
    • 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)
      • getQualifier

        public Name getQualifier()
        Returns the qualifier of this name-qualified type.
        Returns:
        the qualifier of this name-qualified type
      • setQualifier

        public void setQualifier​(Name name)
        Sets the qualifier of this name-qualified type to the given name.
        Parameters:
        name - the new qualifier of this name-qualified type
        Throws:
        IllegalArgumentException - if:
        • the node belongs to a different AST
        • the node already has a parent
      • getName

        public SimpleName getName()
        Returns the name part of this name-qualified type.
        Returns:
        the name being qualified
      • setName

        public void setName​(SimpleName name)
        Sets the name part of this name-qualified type to the given simple name.
        Parameters:
        name - the identifier of this qualified name
        Throws:
        IllegalArgumentException - if:
        • the node belongs to a different AST
        • the node already has a parent