Modifier and Type | Field and Description |
---|---|
static JType |
JType.BOOLEAN
The
boolean primitive type. |
static JType |
JType.BYTE
The
byte primitive type. |
static JType |
JType.CHAR
The
char primitive type. |
static JType |
JType.DOUBLE
The
double primitive type. |
static JType |
JType.FLOAT
The
float primitive type. |
static JType |
JType.INT
The
int primitive type. |
static JType |
JType.LONG
The
long primitive type. |
static JType[] |
JType.NONE
An empty array of types.
|
static JType |
JType.OBJECT
The type of
java.lang.Object . |
static JType |
JType.SHORT
The
short primitive type. |
static JType |
JType.THIS
A special type that always renders to the type of the class it is encountered in.
|
static JType |
JType.VOID
The
void type. |
static JType |
JType.WILDCARD
The wildcard type of
<? extends Object> , also known as <?> . |
Modifier and Type | Method and Description |
---|---|
static JType |
JTypes.$t(Class<?> clazz)
Return the type corresponding to the given class.
|
static JType |
JTypes.$t(JClassDef classDef)
Return the erased type of a class definition.
|
JType |
JType.$t(String name)
Get a nested type within this reference type.
|
static JType |
JTypes.$t(String name)
Return a type corresponding to a class with the given name.
|
JType |
JType.array()
An array of this type.
|
JType |
JType.box()
The primitive-boxed version of this type.
|
JType |
JType.elementType()
The element type, if this an array (otherwise
null ). |
JType |
JClassDef.erasedType()
Get the erased type corresponding to this type definition.
|
JType |
JType.erasure()
The erasure of this type.
|
JType |
JClassDef.genericType()
Get a generic type for this type definition, where the type arguments are the same as the type parameters of this
type (as defined at the time this method is called).
|
JType |
JType.nestedType(String name)
Get a nested type within this reference type.
|
JType |
JParamDeclaration.type()
Get the parameter type.
|
JType |
JVarDeclaration.type()
Get the variable type.
|
JType |
JType.typeArg(Class<?>... args)
This type, with the given generic type arguments.
|
JType |
JType.typeArg(JType... args)
This type, with the given generic type arguments.
|
JType |
JType.typeArg(String... args)
This type, with the given generic type arguments.
|
JType[] |
JType.typeArgs()
Get the type arguments of this type.
|
JType[] |
JCall.typeArguments()
Get the type arguments defined thus far.
|
static JType |
JTypes.typeNamed(String name)
Return a type corresponding to a class with the given name.
|
static JType |
JTypes.typeOf(Class<?> clazz)
Return the type corresponding to the given class.
|
static JType |
JTypes.typeOf(JClassDef classDef)
Return the erased type of a class definition.
|
static JType |
JTypes.typeOf(TypeMirror typeMirror)
Get a
JType that corresponds to the given TypeMirror for annotation processors. |
JType |
JType.unbox()
The primitive-unboxed version of this type.
|
JType |
JType.wildcardExtends()
Get a wildcard that extends this type.
|
JType |
JType.wildcardSuper()
Get a wildcard that this type extends.
|
Modifier and Type | Method and Description |
---|---|
JCatch |
JTry._catch(int mods,
JType type,
String var)
Add a
catch block. |
JClassDef |
JClassDef._extends(JType type)
Add an
extends type to this type. |
JTypeParamDef |
JTypeParamDef._extends(JType type)
Add an
extends bound to this parameter. |
JClassDef |
JClassDef._implements(JType... type)
Add one or more
implements type(s) to this type. |
JSourceFile |
JSourceFile._import(JType type)
Add a type import to this source file.
|
JExpr |
JExpr._instanceof(JType type)
Get a type-testing expression using the
instanceof operator. |
JCall |
JBlock._new(JType type)
Insert an object construction statement at this point.
|
JCall |
JExpr._new(JType type)
Get an expression to construct a new inner class instance of this instance expression.
|
JAnonymousClassDef |
JBlock._newAnon(JType type)
Insert an object construction statement for an anonymous class at this point.
|
JAnonymousClassDef |
JExpr._newAnon(JType type)
Construct a new anonymous subclass of the given type, which must be an inner class of the type of this
expression.
|
JTypeParamDef |
JTypeParamDef._super(JType type)
Add a
super bound to this parameter. |
JHtmlComment |
JDocComment._throws(JType exceptionType)
Add a
@throws tag. |
JComment |
JMethodDef._throws(JType type)
Get a
@throws doc comment block. |
JAnnotation |
JAnnotatable.annotate(JType type)
Add an annotation.
|
JAnnotationArray |
JAnnotation.annotationArrayValue(JType type)
Set the "value" property of this annotation to an array of nested annotations of the given type.
|
JAnnotationArray |
JAnnotation.annotationArrayValue(String name,
JType type)
Set the named property of this annotation to an array of nested annotations of the given type.
|
JAnnotation |
JAnnotation.annotationValue(JType type)
Set the "value" property of this annotation to a nested annotation of the given type.
|
JAnnotation |
JAnnotation.annotationValue(String name,
JType type)
Set the named property of this annotation to a nested annotation of the given type.
|
JCall |
JBlock.callStatic(JType type,
String name)
Insert a type-qualified static method invocation at this point.
|
static JCall |
JExprs.callStatic(JType type,
String name)
Generate a method call expression to a method on the given static type.
|
JExpr |
JExpr.cast(JType type)
Get an expression which is a cast of this expression to the given type.
|
JVarDeclaration |
JClassDefSection.field(int mods,
JType type,
String name)
Add a field to this type.
|
JVarDeclaration |
JClassDefSection.field(int mods,
JType type,
String name,
JExpr init)
Add a field to this type.
|
JBlock |
JBlock.forEach(int mods,
JType type,
String name,
JExpr iterable)
Insert a "for-each" style
for loop at this point. |
JTry |
JTry.ignore(JType type)
Add a
catch for an ignored exception. |
JSourceFile |
JSourceFile.importStatic(JType type,
String member)
Add a static member import to this source file.
|
JVarDeclaration |
JFor.init(int mods,
JType type,
String name,
JExpr value)
Add a loop initializer.
|
JComment |
JComment.linkConstructor(boolean plain,
JType targetType,
JType... targetConstructorArgumentTypes)
Add an inline
@link to a constructor. |
JComment |
JComment.linkConstructor(boolean plain,
JType targetType,
JType... targetConstructorArgumentTypes)
Add an inline
@link to a constructor. |
JComment |
JComment.linkField(boolean plain,
JType targetType,
String targetField)
Add an inline
@link to a field of a type. |
JComment |
JComment.linkMethod(boolean plain,
JType targetType,
String targetMethod,
JType... targetMethodArgumentTypes)
Add an inline
@link to a method. |
JComment |
JComment.linkMethod(boolean plain,
JType targetType,
String targetMethod,
JType... targetMethodArgumentTypes)
Add an inline
@link to a method. |
JComment |
JComment.linkType(boolean plain,
JType targetType)
Add an inline
@link to a type. |
JMethodDef |
JClassDefSection.method(int mods,
JType returnType,
String name)
Add a method to this type.
|
JCatch |
JCatch.or(JType orType)
Add another type option to this catch branch.
|
JParamDeclaration |
JMethodDef.param(int mods,
JType type,
String name)
Add a parameter to this method.
|
JLambda |
JLambda.param(JType type,
String name)
Add a declared-type parameter to this lambda.
|
JParamDeclaration |
JMethodDef.param(JType type,
String name)
Add a parameter to this method.
|
JExpr |
JBlock.tempVar(JType type,
JExpr value)
Insert a local variable declaration at this point with a generated name.
|
JType |
JType.typeArg(JType... args)
This type, with the given generic type arguments.
|
JCall |
JCall.typeArg(JType type)
Add a type argument to this call.
|
JComment |
JComment.typeName(JType type)
Add a type name to the end of this comment.
|
JDocComment |
JDocComment.typeName(JType type)
Add a type name to the end of this comment.
|
JHtmlComment |
JHtmlComment.typeName(JType type)
Add a type name to the end of this comment.
|
JDocComment |
JDocComment.value(JType type,
String fieldName)
Add a
@value inline tag. |
JHtmlComment |
JHtmlComment.value(JType type,
String fieldName)
Add a
@value inline tag. |
JVarDeclaration |
JBlock.var(int mods,
JType type,
String name)
Insert a local variable declaration at this point.
|
JVarDeclaration |
JBlock.var(int mods,
JType type,
String name,
JExpr value)
Insert a local variable declaration at this point.
|
JParamDeclaration |
JMethodDef.varargParam(int mods,
JType type,
String name)
Add a vararg parameter to this method.
|
JParamDeclaration |
JMethodDef.varargParam(JType type,
String name)
Add a vararg parameter to this method.
|
JVarDeclaration |
JTry.with(int mods,
JType type,
String var,
JExpr init)
Add a resource for
try -with-resources constructs. |
Copyright © 2019 JBoss by Red Hat. All rights reserved.