|
Doclet API | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Type
Represents a type. A type can be a class or interface, an
invocation (like List<String>
) of a generic class or interface,
a type variable, a wildcard type ("?
"),
or a primitive data type (like char
).
Method Summary | |
---|---|
AnnotationTypeDoc |
asAnnotationTypeDoc()
Return this type as an AnnotationTypeDoc if it represents
an annotation type. |
ClassDoc |
asClassDoc()
Return this type as a ClassDoc if it represents a class
or interface. |
ParameterizedType |
asParameterizedType()
Return this type as a ParameterizedType if it represents
an invocation of a generic class or interface. |
TypeVariable |
asTypeVariable()
Return this type as a TypeVariable if it represents
a type variable. |
WildcardType |
asWildcardType()
Return this type as a WildcardType if it represents
a wildcard type. |
String |
dimension()
Return the type's dimension information, as a string. |
boolean |
isPrimitive()
Return true if this type represents a primitive type. |
String |
qualifiedTypeName()
Return qualified name of type excluding any dimension information. |
String |
simpleTypeName()
Return the simple name of this type excluding any dimension information. |
String |
toString()
Return a string representation of the type. |
String |
typeName()
Return unqualified name of type excluding any dimension information. |
Method Detail |
---|
String typeName()
For example, a two dimensional array of String returns
"String
".
String qualifiedTypeName()
For example, a two dimensional array of String
returns "java.lang.String
".
String simpleTypeName()
For example, the class Outer.Inner
returns
"Inner
".
String dimension()
For example, a two dimensional array of String returns
"[][]
".
String toString()
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>
".
toString
in class Object
boolean isPrimitive()
ClassDoc asClassDoc()
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 asAnnotationTypeDoc()
).
If this is a primitive type, return null.
ClassDoc
of this type,
or null if it is a primitive type.ParameterizedType asParameterizedType()
ParameterizedType
if it represents
an invocation of a generic class or interface. Array dimensions
are ignored.
ParameterizedType
if the type is an
invocation of a generic type, or null if it is not.TypeVariable asTypeVariable()
TypeVariable
if it represents
a type variable. Array dimensions are ignored.
TypeVariable
if the type is a type variable,
or null if it is not.WildcardType asWildcardType()
WildcardType
if it represents
a wildcard type.
WildcardType
if the type is a wildcard type,
or null if it is not.AnnotationTypeDoc asAnnotationTypeDoc()
AnnotationTypeDoc
if it represents
an annotation type. Array dimensions are ignored.
AnnotationTypeDoc
if the type is an annotation
type, or null if it is not.
|
Doclet API | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |