Package com.google.gwt.core.ext.typeinfo
Interface JType
- All Known Subinterfaces:
JAnnotationType
,JArrayType
,JClassType
,JEnumType
,JGenericType
,JParameterizedType
,JRawType
,JRealClassType
,JTypeParameter
,JWildcardType
- All Known Implementing Classes:
JPrimitiveType
public interface JType
Super interface for types.
-
Method Summary
Modifier and TypeMethodDescriptionReturns this type with no type parameters or type variables.Returns the "field descriptor" for a type as specified by the Java Virtual Machine Specification.For array types, recursively looks for the element type that is not an array.Returns a type name as it would be specified in Java source, with the package name included.A binary type name as specified by the Java Language Spec, ThirdEdition.Returns a type name as it would be specified in Java source, with the package name included.Returns the name of this class without the package name or enclosing class name.Returns this instance as aJAnnotationType
if it is an annotation ornull
if it is not.isArray()
isClass()
Returns this instance if the erased version of this type is a class (as opposed to a primitive, array, or interface) ornull
if it is not.Returns this instance if the erased version of this type is a class or interface (as opposed to a primitive or array array) ornull
if it is not.isEnum()
Returns this instance if it is an enumeration ornull
if it is not.Returns this instance if it is a real class that has type parameters ornull
if it is not.Returns this instance if it is an interface ornull
if it is not.Returns this instance as aJParameterizedType
if it is a parameterized type ornull
if it is not.Returns the raw type if this is aJRawType
, otherwise returnsnull
.
-
Method Details
-
getErasedType
JType getErasedType()Returns this type with no type parameters or type variables. See the JLS Third Edition section on Type Erasure. -
getJNISignature
String getJNISignature()Returns the "field descriptor" for a type as specified by the Java Virtual Machine Specification. Examples:- boolean =
Z
- byte[] =
[B
- java.lang.String =
Ljava/lang/String;
- boolean =
-
getLeafType
JType getLeafType()For array types, recursively looks for the element type that is not an array. Otherwise, returns this type. -
getParameterizedQualifiedSourceName
String getParameterizedQualifiedSourceName()Returns a type name as it would be specified in Java source, with the package name included. Includes the type parameters. If called on a type parameter, does not include any bounds. For example, a type Foodeclared in com.example would be given as "com.example.Foo ", while the same type instantiated with Baz would be "com.example.Foo<com.example.Baz>". -
getQualifiedBinaryName
String getQualifiedBinaryName()A binary type name as specified by the Java Language Spec, ThirdEdition. -
getQualifiedSourceName
String getQualifiedSourceName()Returns a type name as it would be specified in Java source, with the package name included. Does not include the type parameters. If called on a type parameter, includes any bounds. -
getSimpleSourceName
String getSimpleSourceName()Returns the name of this class without the package name or enclosing class name. -
isAnnotation
JAnnotationType isAnnotation()Returns this instance as aJAnnotationType
if it is an annotation ornull
if it is not. -
isArray
JArrayType isArray() -
isClass
JClassType isClass()Returns this instance if the erased version of this type is a class (as opposed to a primitive, array, or interface) ornull
if it is not. -
isClassOrInterface
JClassType isClassOrInterface()Returns this instance if the erased version of this type is a class or interface (as opposed to a primitive or array array) ornull
if it is not. -
isEnum
JEnumType isEnum()Returns this instance if it is an enumeration ornull
if it is not. -
isGenericType
JGenericType isGenericType()Returns this instance if it is a real class that has type parameters ornull
if it is not. -
isInterface
JClassType isInterface()Returns this instance if it is an interface ornull
if it is not. -
isParameterized
JParameterizedType isParameterized()Returns this instance as aJParameterizedType
if it is a parameterized type ornull
if it is not. -
isPrimitive
JPrimitiveType isPrimitive() -
isRawType
JRawType isRawType()Returns the raw type if this is aJRawType
, otherwise returnsnull
. -
isTypeParameter
JTypeParameter isTypeParameter() -
isWildcard
JWildcardType isWildcard()
-