public final class JPrimitiveType extends JType
JCodeModel,
such as JCodeModel.BOOLEAN.| Modifier and Type | Method and Description |
|---|---|
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.
|
binaryName, compareTo, elementType, erasure, isArray, isReference, parse, toStringpublic JCodeModel owner()
JTypepublic String fullName()
JTypepublic boolean isPrimitive()
JTypeisPrimitive in class JTypepublic JClass array()
JTypepublic JClass boxify()
public JType unboxify()
JPrimitiveType
would be meaningless, since it's always guaranteed to
return this.JTypethis.
For example, for "java.lang.Integer", this method returns "int".
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)
Copyright © 2018 JBoss by Red Hat. All rights reserved.