Class AbstractTypeImpl

  • All Implemented Interfaces:
    Type
    Direct Known Subclasses:
    AnnotatedTypeImpl, ParameterizedTypeImpl, TypeVariableImpl, WildcardTypeImpl

    @Deprecated
    abstract class AbstractTypeImpl
    extends java.lang.Object
    implements Type
    Deprecated.
    Abstract implementation of Type, with useful defaults for the methods in Type (and a couple from ProgramElementDoc).

    This is NOT part of any supported API. If you write code that depends on this, you do so at your own risk. This code and its internal interfaces are subject to change or deletion without notice.

    Since:
    1.5
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected DocEnv env
      Deprecated.
       
      protected com.sun.tools.javac.code.Type type
      Deprecated.
       
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      protected AbstractTypeImpl​(DocEnv env, com.sun.tools.javac.code.Type type)
      Deprecated.
       
    • Method Summary

      All Methods Instance Methods Concrete Methods Deprecated Methods 
      Modifier and Type Method Description
      AnnotatedType asAnnotatedType()
      Deprecated.
      Returns this type as a AnnotatedType if it represents an annotated type.
      AnnotationTypeDoc asAnnotationTypeDoc()
      Deprecated.
      Return this type as an AnnotationTypeDoc if it represents an annotation type.
      ClassDoc asClassDoc()
      Deprecated.
      Return this type as a ClassDoc if it represents a class or interface.
      ParameterizedType asParameterizedType()
      Deprecated.
      Return this type as a ParameterizedType if it represents an invocation of a generic class or interface.
      TypeVariable asTypeVariable()
      Deprecated.
      Return this type as a TypeVariable if it represents a type variable.
      WildcardType asWildcardType()
      Deprecated.
      Return this type as a WildcardType if it represents a wildcard type.
      java.lang.String dimension()
      Deprecated.
      Return the type's dimension information, as a string.
      Type getElementType()
      Deprecated.
      If this type is an array type, return the element type of the array.
      boolean isPrimitive()
      Deprecated.
      Return true if this type represents a primitive type.
      java.lang.String name()
      Deprecated.
       
      java.lang.String qualifiedName()
      Deprecated.
       
      java.lang.String qualifiedTypeName()
      Deprecated.
      Return qualified name of type excluding any dimension information.
      java.lang.String simpleTypeName()
      Deprecated.
      Return the simple name of this type excluding any dimension information.
      java.lang.String toString()
      Deprecated.
      Return a string representation of the type.
      java.lang.String typeName()
      Deprecated.
      Return unqualified name of type excluding any dimension information.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Field Detail

      • env

        protected final DocEnv env
        Deprecated.
      • type

        protected final com.sun.tools.javac.code.Type type
        Deprecated.
    • Constructor Detail

      • AbstractTypeImpl

        protected AbstractTypeImpl​(DocEnv env,
                                   com.sun.tools.javac.code.Type type)
        Deprecated.
    • Method Detail

      • typeName

        public java.lang.String typeName()
        Deprecated.
        Description copied from interface: Type
        Return unqualified name of type excluding any dimension information.

        For example, a two dimensional array of String returns "String".

        Specified by:
        typeName in interface Type
        Returns:
        unqualified name of type excluding any dimension information.
      • qualifiedTypeName

        public java.lang.String qualifiedTypeName()
        Deprecated.
        Description copied from interface: Type
        Return qualified name of type excluding any dimension information.

        For example, a two dimensional array of String returns "java.lang.String".

        Specified by:
        qualifiedTypeName in interface Type
        Returns:
        qualified name of this type excluding any dimension information.
      • getElementType

        public Type getElementType()
        Deprecated.
        Description copied from interface: Type
        If this type is an array type, return the element type of the array. Otherwise, return null.
        Specified by:
        getElementType in interface Type
        Returns:
        a Type representing the element type or null.
      • simpleTypeName

        public java.lang.String simpleTypeName()
        Deprecated.
        Description copied from interface: Type
        Return the simple name of this type excluding any dimension information. This is the unqualified name of the type, except that for nested types only the identifier of the innermost type is included.

        For example, the class Outer.Inner returns "Inner".

        Specified by:
        simpleTypeName in interface Type
        Returns:
        the simple name of this type excluding any dimension information.
      • name

        public java.lang.String name()
        Deprecated.
      • qualifiedName

        public java.lang.String qualifiedName()
        Deprecated.
      • toString

        public java.lang.String toString()
        Deprecated.
        Description copied from interface: Type
        Return a string representation of the type. This includes any dimension information and type arguments.

        For example, a two dimensional array of String may return "java.lang.String[][]", and the parameterized type List<Integer> may return "java.util.List<java.lang.Integer>".

        Specified by:
        toString in interface Type
        Overrides:
        toString in class java.lang.Object
        Returns:
        a string representation of the type.
      • dimension

        public java.lang.String dimension()
        Deprecated.
        Description copied from interface: Type
        Return the type's dimension information, as a string.

        For example, a two dimensional array of String returns "[][]".

        Specified by:
        dimension in interface Type
        Returns:
        the type's dimension information as a string.
      • isPrimitive

        public boolean isPrimitive()
        Deprecated.
        Description copied from interface: Type
        Return true if this type represents a primitive type.
        Specified by:
        isPrimitive in interface Type
        Returns:
        true if this type represents a primitive type.
      • asClassDoc

        public ClassDoc asClassDoc()
        Deprecated.
        Description copied from interface: Type
        Return this type as a ClassDoc if it represents a class or interface. Array dimensions are ignored. If this type is a ParameterizedType, TypeVariable, or WildcardType, return the ClassDoc of the type's erasure. If this is an AnnotationTypeDoc, return this as a ClassDoc (but see Type.asAnnotationTypeDoc()). If this is a primitive type, return null.
        Specified by:
        asClassDoc in interface Type
        Returns:
        the ClassDoc of this type, or null if it is a primitive type.
      • asTypeVariable

        public TypeVariable asTypeVariable()
        Deprecated.
        Description copied from interface: Type
        Return this type as a TypeVariable if it represents a type variable. Array dimensions are ignored.
        Specified by:
        asTypeVariable in interface Type
        Returns:
        a TypeVariable if the type is a type variable, or null if it is not.
      • asWildcardType

        public WildcardType asWildcardType()
        Deprecated.
        Description copied from interface: Type
        Return this type as a WildcardType if it represents a wildcard type.
        Specified by:
        asWildcardType in interface Type
        Returns:
        a WildcardType if the type is a wildcard type, or null if it is not.
      • asParameterizedType

        public ParameterizedType asParameterizedType()
        Deprecated.
        Description copied from interface: Type
        Return this type as a ParameterizedType if it represents an invocation of a generic class or interface. Array dimensions are ignored.
        Specified by:
        asParameterizedType in interface Type
        Returns:
        a ParameterizedType if the type is an invocation of a generic type, or null if it is not.
      • asAnnotationTypeDoc

        public AnnotationTypeDoc asAnnotationTypeDoc()
        Deprecated.
        Description copied from interface: Type
        Return this type as an AnnotationTypeDoc if it represents an annotation type. Array dimensions are ignored.
        Specified by:
        asAnnotationTypeDoc in interface Type
        Returns:
        an AnnotationTypeDoc if the type is an annotation type, or null if it is not.
      • asAnnotatedType

        public AnnotatedType asAnnotatedType()
        Deprecated.
        Description copied from interface: Type
        Returns this type as a AnnotatedType if it represents an annotated type.
        Specified by:
        asAnnotatedType in interface Type
        Returns:
        a AnnotatedType if the type if an annotated type, or null if it is not