public abstract class JType extends Object implements JGenerable, Comparable<JType>
JPrimitiveType
) or
a reference type (JClass
).Constructor and Description |
---|
JType() |
Modifier and Type | Method and Description |
---|---|
abstract JClass |
array()
Create an array type of this type.
|
String |
binaryName()
Gets the binary name of the type.
|
abstract JClass |
boxify()
If this class is a primitive type, return the boxed class.
|
int |
compareTo(JType o)
Compare two JTypes by FQCN, giving sorting precedence to types
that belong to packages java and javax over all others.
|
JType |
elementType()
If this is an array, returns the component type of the array.
|
JType |
erasure()
Returns the erasure of this type.
|
abstract String |
fullName()
Gets the full name of the type.
|
boolean |
isArray()
Tell whether or not this is an array type.
|
boolean |
isPrimitive()
Tell whether or not this is a built-in primitive type, such as int or void.
|
boolean |
isReference()
Returns true if this is a referenced type.
|
abstract String |
name()
Gets the name of this type.
|
abstract JCodeModel |
owner()
Gets the owner code model object.
|
static JPrimitiveType |
parse(JCodeModel codeModel,
String typeName)
Obtains a reference to the primitive type object from a type name.
|
String |
toString() |
abstract JType |
unboxify()
If this class is a wrapper type for a primitive, return the primitive type.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
generate
public static JPrimitiveType parse(JCodeModel codeModel, String typeName)
public abstract JCodeModel owner()
public abstract String fullName()
public String binaryName()
public abstract String name()
public abstract JClass array()
JClass
representing the array type
whose element type is this typepublic boolean isArray()
public boolean isPrimitive()
public abstract JClass boxify()
this
.
For example, for "int", this method returns "java.lang.Integer".
public abstract JType unboxify()
this
.
For example, for "java.lang.Integer", this method returns "int".
public JType erasure()
public final boolean isReference()
public JType elementType()
public int compareTo(JType o)
compareTo
in interface Comparable<JType>
Copyright © 2019 JBoss by Red Hat. All rights reserved.