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, toString
public JCodeModel owner()
JType
public String fullName()
JType
public boolean isPrimitive()
JType
isPrimitive
in class JType
public JClass array()
JType
public JClass boxify()
public JType unboxify()
JPrimitiveType
would be meaningless, since it's always guaranteed to
return this.JType
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 © 2017 JBoss by Red Hat. All rights reserved.