| java.lang.Object com.sun.codemodel.JType
All known Subclasses: com.sun.codemodel.JPrimitiveType, com.sun.codemodel.JClass,
Method Summary | |
abstract public JClass | array() Create an array type of this type. | public String | binaryName() Gets the binary name of the type.
See http://java.sun.com/docs/books/jls/third_edition/html/binaryComp.html#44909
Name like "Foo$Bar", "int", "java.lang.String", "java.io.File[]". | abstract public JClass | boxify() If this class is a primitive type, return the boxed class. | public int | compareTo(Object o) Compare two JTypes by FQCN, giving sorting precedence to types
that belong to packages java and javax over all others. | public JType | elementType() If this is an array, returns the component type of the array. | public JType | erasure() Returns the erasure of this type. | abstract public String | fullName() Gets the full name of the type.
See http://java.sun.com/docs/books/jls/second_edition/html/names.doc.html#25430 for the details.
Strings like "int", "java.lang.String","java.io.File[]". | public boolean | isArray() Tell whether or not this is an array type. | public boolean | isPrimitive() Tell whether or not this is a built-in primitive type, such as int or void. | final public boolean | isReference() Returns true if this is a referenced type. | abstract public String | name() Gets the name of this type. | abstract public JCodeModel | owner() Gets the owner code model object. | public static JPrimitiveType | parse(JCodeModel codeModel, String typeName) Obtains a reference to the primitive type object from a type name. | public String | toString() | abstract public JType | unboxify() If this class is a wrapper type for a primitive, return the primitive type. |
array | abstract public JClass array()(Code) | | Create an array type of this type.
This method is undefined for primitive void type, which
doesn't have any corresponding array representation.
A JClass representing the array typewhose element type is this type |
binaryName | public String binaryName()(Code) | | Gets the binary name of the type.
See http://java.sun.com/docs/books/jls/third_edition/html/binaryComp.html#44909
Name like "Foo$Bar", "int", "java.lang.String", "java.io.File[]". Never null. |
boxify | abstract public JClass boxify()(Code) | | If this class is a primitive type, return the boxed class. Otherwise return this.
For example, for "int", this method returns "java.lang.Integer".
|
compareTo | public int compareTo(Object o)(Code) | | Compare two JTypes by FQCN, giving sorting precedence to types
that belong to packages java and javax over all others.
This method is used to sort generated import statments in a
conventional way for readability.
|
elementType | public JType elementType()(Code) | | If this is an array, returns the component type of the array.
(T of T[])
|
erasure | public JType erasure()(Code) | | Returns the erasure of this type.
|
fullName | abstract public String fullName()(Code) | | Gets the full name of the type.
See http://java.sun.com/docs/books/jls/second_edition/html/names.doc.html#25430 for the details.
Strings like "int", "java.lang.String","java.io.File[]". Never null. |
isArray | public boolean isArray()(Code) | | Tell whether or not this is an array type.
|
isPrimitive | public boolean isPrimitive()(Code) | | Tell whether or not this is a built-in primitive type, such as int or void.
|
isReference | final public boolean isReference()(Code) | | Returns true if this is a referenced type.
|
name | abstract public String name()(Code) | | Gets the name of this type.
Names like "int", "void", "BigInteger". |
unboxify | abstract public JType unboxify()(Code) | | If this class is a wrapper type for a primitive, return the primitive type.
Otherwise return this.
For example, for "java.lang.Integer", this method returns "int".
|
|
|