|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.sun.codemodel.JType
com.sun.codemodel.JPrimitiveType
public final class JPrimitiveType
Java built-in primitive types.
Instances of this class can be obtained as constants of JCodeModel,
such as JCodeModel.BOOLEAN.
| Method Summary | |
|---|---|
JClass |
array()
Create an array type of this type. |
JClass |
boxify()
Obtains the wrapper class for this primitive type. |
String |
fullName()
Gets the full name of the type. |
void |
generate(JFormatter f)
|
JClass |
getWrapperClass()
Deprecated. Use boxify(). |
boolean |
isPrimitive()
Tell whether or not this is a built-in primitive type, such as int or void. |
String |
name()
Gets the name of this type. |
JCodeModel |
owner()
Gets the owner code model object. |
JType |
unboxify()
Deprecated. calling this method from JPrimitiveType
would be meaningless, since it's always guaranteed to
return this. |
JExpression |
unwrap(JExpression exp)
Do the opposite of the wrap method. |
JExpression |
wrap(JExpression exp)
Wraps an expression of this type to the corresponding wrapper class. |
| Methods inherited from class com.sun.codemodel.JType |
|---|
binaryName, compareTo, elementType, erasure, isArray, isReference, parse, toString |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Method Detail |
|---|
public JCodeModel owner()
JType
owner in class JTypepublic String fullName()
JType
fullName in class JTypepublic String name()
JType
name in class JTypepublic boolean isPrimitive()
JType
isPrimitive in class JTypepublic JClass array()
JType
array in class JTypeJClass representing the array type
whose element type is this typepublic JClass boxify()
boxify in class JTypepublic JType unboxify()
JPrimitiveType
would be meaningless, since it's always guaranteed to
return this.
JTypeFor example, for "java.lang.Integer", this method returns "int".
unboxify in class JTypepublic JClass getWrapperClass()
boxify().
public JExpression wrap(JExpression exp)
new Float(x) for the paramter x.
REVISIT: it's not clear how this method works for VOID.
public JExpression unwrap(JExpression exp)
public void generate(JFormatter f)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||