Class TypeMaker.ArrayTypeImpl

  • All Implemented Interfaces:
    Type
    Enclosing class:
    TypeMaker

    private static class TypeMaker.ArrayTypeImpl
    extends java.lang.Object
    implements Type
    • Field Detail

      • arrayType

        com.sun.tools.javac.code.Type arrayType
      • skipArraysCache

        private Type skipArraysCache
    • Constructor Detail

      • ArrayTypeImpl

        ArrayTypeImpl​(DocEnv env,
                      com.sun.tools.javac.code.Type arrayType)
    • Method Detail

      • getElementType

        public Type getElementType()
        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.
      • skipArrays

        private Type skipArrays()
      • dimension

        public java.lang.String dimension()
        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.
      • typeName

        public java.lang.String typeName()
        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()
        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.
      • simpleTypeName

        public java.lang.String simpleTypeName()
        Return the simple name of this type excluding any dimension information.
        Specified by:
        simpleTypeName in interface Type
        Returns:
        the simple name of this type excluding any dimension information.
      • asClassDoc

        public ClassDoc asClassDoc()
        Return this type as a class. Array dimensions are ignored.
        Specified by:
        asClassDoc in interface Type
        Returns:
        a ClassDocImpl if the type is a Class. Return null if it is a primitive type..
      • asParameterizedType

        public ParameterizedType asParameterizedType()
        Return this type as a ParameterizedType if it represents a parameterized type. 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.
      • asTypeVariable

        public TypeVariable asTypeVariable()
        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()
        Return null, as there are no arrays of wildcard types.
        Specified by:
        asWildcardType in interface Type
        Returns:
        a WildcardType if the type is a wildcard type, or null if it is not.
      • asAnnotatedType

        public AnnotatedType asAnnotatedType()
        Return null, as there are no annotations of the type
        Specified by:
        asAnnotatedType in interface Type
        Returns:
        a AnnotatedType if the type if an annotated type, or null if it is not
      • asAnnotationTypeDoc

        public AnnotationTypeDoc asAnnotationTypeDoc()
        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.
      • isPrimitive

        public boolean isPrimitive()
        Return true if this is an array of a primitive type.
        Specified by:
        isPrimitive in interface Type
        Returns:
        true if this type represents a primitive type.
      • toString

        public java.lang.String toString()
        Return a string representation of the type. Return name of type including any dimension information.

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

        Specified by:
        toString in interface Type
        Overrides:
        toString in class java.lang.Object
        Returns:
        name of type including any dimension information.