Package com.google.gwt.core.ext.typeinfo
Enum JPrimitiveType
- All Implemented Interfaces:
JType
,Serializable
,Comparable<JPrimitiveType>
,java.lang.constant.Constable
Represents a primitive type in a declaration.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
-
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
.static JPrimitiveType
toString()
static JPrimitiveType
Returns the enum constant of this type with the specified name.static JPrimitiveType[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
Enum Constant Details
-
BOOLEAN
-
BYTE
-
CHAR
-
DOUBLE
-
FLOAT
-
INT
-
LONG
-
SHORT
-
VOID
-
-
Method Details
-
values
Returns an array containing the constants of this enum type, in the order they are declared.- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is null
-
parse
-
getErasedType
Description copied from interface:JType
Returns this type with no type parameters or type variables. See the JLS Third Edition section on Type Erasure.- Specified by:
getErasedType
in interfaceJType
-
getJNISignature
Description copied from interface:JType
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;
- Specified by:
getJNISignature
in interfaceJType
- boolean =
-
getLeafType
Description copied from interface:JType
For array types, recursively looks for the element type that is not an array. Otherwise, returns this type.- Specified by:
getLeafType
in interfaceJType
-
getParameterizedQualifiedSourceName
Description copied from interface:JType
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>". - Specified by:
getParameterizedQualifiedSourceName
in interfaceJType
-
getQualifiedBinaryName
Description copied from interface:JType
A binary type name as specified by the Java Language Spec, ThirdEdition.- Specified by:
getQualifiedBinaryName
in interfaceJType
-
getQualifiedBoxedSourceName
-
getQualifiedSourceName
Description copied from interface:JType
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.- Specified by:
getQualifiedSourceName
in interfaceJType
-
getSimpleSourceName
Description copied from interface:JType
Returns the name of this class without the package name or enclosing class name.- Specified by:
getSimpleSourceName
in interfaceJType
-
getUninitializedFieldExpression
-
isAnnotation
Description copied from interface:JType
Returns this instance as aJAnnotationType
if it is an annotation ornull
if it is not.- Specified by:
isAnnotation
in interfaceJType
-
isArray
-
isClass
Description copied from interface:JType
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
Description copied from interface:JType
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.- Specified by:
isClassOrInterface
in interfaceJType
-
isEnum
Description copied from interface:JType
Returns this instance if it is an enumeration ornull
if it is not. -
isGenericType
Description copied from interface:JType
Returns this instance if it is a real class that has type parameters ornull
if it is not.- Specified by:
isGenericType
in interfaceJType
-
isInterface
Description copied from interface:JType
Returns this instance if it is an interface ornull
if it is not.- Specified by:
isInterface
in interfaceJType
-
isParameterized
Description copied from interface:JType
Returns this instance as aJParameterizedType
if it is a parameterized type ornull
if it is not.- Specified by:
isParameterized
in interfaceJType
-
isPrimitive
- Specified by:
isPrimitive
in interfaceJType
-
isRawType
Description copied from interface:JType
Returns the raw type if this is aJRawType
, otherwise returnsnull
. -
isTypeParameter
- Specified by:
isTypeParameter
in interfaceJType
-
isWildcard
- Specified by:
isWildcard
in interfaceJType
-
toString
- Overrides:
toString
in classEnum<JPrimitiveType>
-