Package | Description |
---|---|
com.sun.codemodel |
Library for generating Java source code
|
com.sun.codemodel.fmt |
Modifier and Type | Class and Description |
---|---|
(package private) class |
JAnonymousClass
Anonymous class quick hack.
|
(package private) class |
JArrayClass
Array class.
|
class |
JClass
Represents a Java reference type, such as a class, an interface,
an enum, an array type, a parameterized type.
|
private class |
JCodeModel.JReferencedClass
References to existing classes.
|
class |
JDefinedClass
A generated Java class/interface/enum/....
|
(package private) class |
JDirectClass
A special
JClass that represents an unknown class (except its name.) |
(package private) class |
JNarrowedClass
Represents X<Y>.
|
class |
JNullType
Special class object that represents the type of "null".
|
class |
JPrimitiveType
Java built-in primitive types.
|
class |
JTypeVar
Type variable used to declare generics.
|
(package private) class |
JTypeWildcard
Represents a wildcard type like "? extends Foo".
|
Modifier and Type | Field and Description |
---|---|
private JType |
JArrayClass.componentType |
private JType |
JVar.type
JType of the variable
|
private JType |
JForEach.type |
private JType |
JMethod.type
Return type for this method
|
private JType |
JArray.type |
private JType |
JCast.type
JType to which the expression is to be cast.
|
private JType |
JInvocation.type
If isConstructor==true, this field keeps the type to be created.
|
Modifier and Type | Method and Description |
---|---|
JType |
JCodeModel._ref(java.lang.Class<?> c) |
JType |
JArrayClass.elementType() |
JType |
JType.elementType()
If this is an array, returns the component type of the array.
|
JType |
JType.erasure()
Returns the erasure of this type.
|
JType[] |
JMethod.listParamTypes()
Returns all the parameter types in an array.
|
JType |
JMethod.listVarParamType()
Returns the varags parameter type.
|
JType |
JCodeModel.parseType(java.lang.String name)
Obtains a type object from a type name.
|
JType |
JVar.type()
Return the type of this variable.
|
JType |
JMethod.type()
Returns the return type.
|
JType |
JVar.type(JType newType)
Sets the type of this variable.
|
JType |
JPrimitiveType.unboxify()
Deprecated.
calling this method from
JPrimitiveType
would be meaningless, since it's always guaranteed to
return this. |
JType |
JClass.unboxify() |
abstract JType |
JType.unboxify()
If this class is a wrapper type for a primitive, return the primitive type.
|
Modifier and Type | Method and Description |
---|---|
static JExpression |
JOp._instanceof(JExpression left,
JType right) |
JExpression |
JExpressionImpl._instanceof(JType right) |
JExpression |
JExpression._instanceof(JType right)
Returns "[this] instanceof [right]"
|
static JInvocation |
JExpr._new(JType t) |
static JCast |
JExpr.cast(JType type,
JExpression expr) |
int |
JType.compareTo(JType o)
Compare two JTypes by FQCN, giving sorting precedence to types
that belong to packages java and javax over all others.
|
JVar |
JBlock.decl(int mods,
JType type,
java.lang.String name,
JExpression init)
Adds a local variable declaration to this block
|
JVar |
JBlock.decl(JType type,
java.lang.String name)
Adds a local variable declaration to this block
|
JVar |
JBlock.decl(JType type,
java.lang.String name,
JExpression init)
Adds a local variable declaration to this block
|
JFieldVar |
JDefinedClass.field(int mods,
JType type,
java.lang.String name)
Adds a field to the list of field members of this JDefinedClass.
|
JFieldVar |
JDefinedClass.field(int mods,
JType type,
java.lang.String name,
JExpression init)
Adds a field to the list of field members of this JDefinedClass.
|
JForEach |
JBlock.forEach(JType varType,
java.lang.String name,
JExpression collection)
Creates an enhanced For statement based on j2se 1.5 JLS
and add it to this block
|
JMethod |
JDefinedClass.getConstructor(JType[] argTypes)
Looks for a method that has the specified method signature
and return it.
|
JMethod |
JDefinedClass.getMethod(java.lang.String name,
JType[] argTypes)
Looks for a method that has the specified method signature
and return it.
|
boolean |
JMethod.hasSignature(JType[] argTypes)
Returns true if the method has the specified signature.
|
JVar |
JForLoop.init(int mods,
JType type,
java.lang.String var,
JExpression e) |
JVar |
JForLoop.init(JType type,
java.lang.String var,
JExpression e) |
JMethod |
JDefinedClass.method(int mods,
JType type,
java.lang.String name)
Add a method to the list of method members of this JDefinedClass instance.
|
JClass |
JClass.narrow(JType type) |
static JArray |
JExpr.newArray(JType type) |
static JArray |
JExpr.newArray(JType type,
int size)
Generates
new T[size] . |
static JArray |
JExpr.newArray(JType type,
JExpression size)
Generates
new T[size] . |
JVar |
JMethod.param(int mods,
JType type,
java.lang.String name)
Add the specified variable to the list of parameters
for this method signature.
|
JAnnotationArrayMember |
JAnnotationArrayMember.param(JType type) |
JVar |
JMethod.param(JType type,
java.lang.String name) |
JAnnotationUse |
JAnnotationUse.param(java.lang.String name,
JType type)
Adds a member value pair to this annotation based on the
type represented by the given JType
|
JFormatter |
JFormatter.t(JType type) |
JType |
JVar.type(JType newType)
Sets the type of this variable.
|
void |
JMethod.type(JType t)
Overrides the return type.
|
JVar |
JMethod.varParam(JType type,
java.lang.String name)
Add the specified variable argument to the list of parameters
for this method signature.
|
Constructor and Description |
---|
JArray(JType type,
JExpression size) |
JArrayClass(JCodeModel owner,
JType component) |
JCast(JType type,
JExpression object)
JCast constructor
|
JFieldRef(JType type,
JVar v) |
JFieldRef(JType type,
java.lang.String name)
Static field reference.
|
JFieldVar(JDefinedClass owner,
JMods mods,
JType type,
java.lang.String name,
JExpression init)
JFieldVar constructor
|
JForEach(JType vartype,
java.lang.String variable,
JExpression collection) |
JInvocation(JType c)
Invokes a constructor of an object (i.e., creates
a new object.)
|
JMethod(JDefinedClass outer,
int mods,
JType type,
java.lang.String name)
JMethod constructor
|
JVar(JMods mods,
JType type,
java.lang.String name,
JExpression init)
JVar constructor
|
Modifier and Type | Class and Description |
---|---|
private class |
JStaticJavaFile.JStaticClass |