com.sun.codemodel
public abstract class JType extends java.lang.Object implements java.lang.Comparable
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.
|
java.lang.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(java.lang.Object 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 java.lang.String |
fullName()
Gets the full name of the type.
|
void |
generate(JFormatter f) |
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 java.lang.String |
name()
Gets the name of this type.
|
abstract JCodeModel |
owner()
Gets the owner code model object.
|
static JPrimitiveType |
parse(JCodeModel codeModel,
java.lang.String typeName)
Obtains a reference to the primitive type object from a type name.
|
java.lang.String |
toString() |
abstract JType |
unboxify()
If this class is a wrapper type for a primitive, return the primitive type.
|
public static JPrimitiveType parse(JCodeModel codeModel, java.lang.String typeName)
public abstract JCodeModel owner()
public abstract java.lang.String fullName()
public java.lang.String binaryName()
public abstract java.lang.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()
For example, for "int", this method returns "java.lang.Integer".
public abstract JType unboxify()
For example, for "java.lang.Integer", this method returns "int".
public JType erasure()
public final boolean isReference()
public JType elementType()
public java.lang.String toString()
toString
in class java.lang.Object
public int compareTo(java.lang.Object o)
compareTo
in interface java.lang.Comparable
public void generate(JFormatter f)
Copyright © 2005-2014 Sun Microsystems. All Rights Reserved.