Modifier and Type | Class and Description |
---|---|
(package private) class |
AbstractJType |
(package private) class |
ArrayJType |
(package private) class |
NarrowedJType |
(package private) class |
NestedJType |
(package private) class |
PrimitiveJType |
(package private) class |
ReferenceJType |
(package private) class |
ThisJType |
(package private) class |
WildcardJType |
Modifier and Type | Field and Description |
---|---|
private JType |
AbstractJClassDef._extends |
private JType[] |
NarrowedJType.args |
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. |
private JType |
AbstractJClassDef.erased |
static JType |
JType.FLOAT
The
float primitive type. |
private JType |
AbstractJClassDef.generic |
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 . |
private JType |
MethodJMethodDef.returnType |
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.
|
private JType |
StaticJCall.type |
private JType |
InstanceOfJExpr.type |
private JType |
ImplJAnonymousClassDef.type |
private JType |
ImplJParamDeclaration.type |
private JType |
ImplJAnnotationArray.type |
private JType |
CastJExpr.type |
private JType |
JTypeCommentContent.type |
private JType |
ForEachJBlock.type |
private JType |
ImplJAnnotation.type |
private JType |
FirstJVarDeclaration.type |
private JType |
JLambdaImpl.Param.type |
static JType |
JType.VOID
The
void type. |
static JType |
JType.WILDCARD
The wildcard type of
<? extends Object> , also known as <?> . |
Modifier and Type | Field and Description |
---|---|
private java.util.ArrayList<JType> |
ImplJTypeParamDef._extends |
private java.util.ArrayList<JType> |
AbstractJClassDef._implements |
private java.util.ArrayList<JType> |
ImplJTypeParamDef._super |
(package private) static java.lang.ThreadLocal<java.util.LinkedHashMap<java.lang.String,JType>> |
JTypes.cache |
private java.util.ArrayList<JType> |
ImplJCatch.types |
Modifier and Type | Method and Description |
---|---|
static JType |
JTypes.$t(java.lang.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 |
AbstractJType.$t(java.lang.String name) |
static JType |
JTypes.$t(java.lang.String name)
Return a type corresponding to a class with the given name.
|
JType |
JType.$t(java.lang.String name)
Get a nested type within this reference type.
|
JType |
AbstractJType.array() |
JType |
WildcardJType.array() |
JType |
JType.array()
An array of this type.
|
JType |
PrimitiveJType.box() |
JType |
AbstractJType.box() |
JType |
JType.box()
The primitive-boxed version of this type.
|
private static JType[] |
NarrowedJType.concat(JType[] a,
JType[] b) |
JType |
AbstractJType.elementType() |
JType |
ArrayJType.elementType() |
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 |
ImplJAnonymousClassDef.erasedType() |
JType |
AbstractJClassDef.erasedType() |
JType |
AbstractJType.erasure() |
JType |
NarrowedJType.erasure() |
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 |
ImplJAnonymousClassDef.genericType() |
JType |
AbstractJClassDef.genericType() |
(package private) JType |
AbstractJClassDef.getExtends() |
(package private) JType |
MethodJMethodDef.getReturnType() |
(package private) JType |
StaticJCall.getType() |
(package private) JType |
InstanceOfJExpr.getType() |
(package private) JType |
CastJExpr.getType() |
(package private) JType |
JTypeCommentContent.getType() |
JType |
JLambdaImpl.Param.getType() |
JType |
ReferenceJType.nestedType(java.lang.String name) |
JType |
AbstractJType.nestedType(java.lang.String name) |
JType |
NestedJType.nestedType(java.lang.String name) |
JType |
NarrowedJType.nestedType(java.lang.String name) |
JType |
JType.nestedType(java.lang.String name)
Get a nested type within this reference type.
|
JType |
ImplJAnonymousClassDef.type() |
JType |
JParamDeclaration.type()
Get the parameter type.
|
JType |
ImplJParamDeclaration.type() |
JType |
SuccessorJVarDeclaration.type() |
JType |
JVarDeclaration.type()
Get the variable type.
|
JType |
FirstJVarDeclaration.type() |
JType |
AbstractJType.typeArg(java.lang.Class<?>... args) |
JType |
JType.typeArg(java.lang.Class<?>... args)
This type, with the given generic type arguments.
|
JType |
ReferenceJType.typeArg(JType... args) |
JType |
AbstractJType.typeArg(JType... args) |
JType |
NestedJType.typeArg(JType... args) |
JType |
NarrowedJType.typeArg(JType... args) |
JType |
JType.typeArg(JType... args)
This type, with the given generic type arguments.
|
JType |
AbstractJType.typeArg(java.lang.String... args) |
JType |
JType.typeArg(java.lang.String... args)
This type, with the given generic type arguments.
|
JType[] |
AbstractJType.typeArgs() |
JType[] |
NarrowedJType.typeArgs() |
JType[] |
JType.typeArgs()
Get the type arguments of this type.
|
JType[] |
AbstractJCall.typeArguments() |
JType[] |
JCall.typeArguments()
Get the type arguments defined thus far.
|
static JType |
JTypes.typeNamed(java.lang.String name)
Return a type corresponding to a class with the given name.
|
static JType |
JTypes.typeOf(java.lang.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(javax.lang.model.type.TypeMirror typeMirror)
Get a
JType that corresponds to the given TypeMirror for annotation processors. |
(package private) JType[] |
AbstractJGeneric.typeParamsToArgs() |
JType |
ReferenceJType.unbox() |
JType |
AbstractJType.unbox() |
JType |
JType.unbox()
The primitive-unboxed version of this type.
|
JType |
AbstractJType.wildcardExtends() |
JType |
WildcardJType.wildcardExtends() |
JType |
JType.wildcardExtends()
Get a wildcard that extends this type.
|
JType |
AbstractJType.wildcardSuper() |
JType |
WildcardJType.wildcardSuper() |
JType |
JType.wildcardSuper()
Get a wildcard that this type extends.
|
Modifier and Type | Method and Description |
---|---|
(package private) java.lang.Iterable<JType> |
ImplJTypeParamDef.getExtends() |
(package private) java.lang.Iterable<JType> |
AbstractJClassDef.getImplements() |
(package private) java.lang.Iterable<JType> |
ImplJTypeParamDef.getSuper() |
(package private) java.util.ArrayList<JType> |
ImplJCatch.getTypes() |
Modifier and Type | Method and Description |
---|---|
JCatch |
ImplJTry._catch(int mods,
JType type,
java.lang.String var) |
JCatch |
ImplJCatch._catch(int mods,
JType type,
java.lang.String var) |
JCatch |
JTry._catch(int mods,
JType type,
java.lang.String var)
Add a
catch block. |
JClassDef |
JClassDef._extends(JType type)
Add an
extends type to this type. |
JClassDef |
InterfaceJClassDef._extends(JType type) |
JClassDef |
ImplJAnonymousClassDef._extends(JType type) |
JClassDef |
AnnotationJClassDef._extends(JType type) |
JTypeParamDef |
JTypeParamDef._extends(JType type)
Add an
extends bound to this parameter. |
JClassDef |
AbstractJClassDef._extends(JType type) |
JClassDef |
EnumJClassDef._extends(JType type) |
JTypeParamDef |
ImplJTypeParamDef._extends(JType type) |
JClassDef |
JClassDef._implements(JType... type)
Add one or more
implements type(s) to this type. |
JClassDef |
ImplJAnonymousClassDef._implements(JType... types) |
JClassDef |
AnnotationJClassDef._implements(JType... types) |
JClassDef |
AbstractJClassDef._implements(JType... types) |
JSourceFile |
ImplJSourceFile._import(JType type) |
JSourceFile |
JSourceFile._import(JType type)
Add a type import to this source file.
|
JExpr |
AbstractJExpr._instanceof(JType type) |
JExpr |
JExpr._instanceof(JType type)
Get a type-testing expression using the
instanceof operator. |
JCall |
BasicJBlock._new(JType type) |
JCall |
AbstractJExpr._new(JType type) |
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 |
BasicJBlock._newAnon(JType type) |
JAnonymousClassDef |
AbstractJExpr._newAnon(JType type) |
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. |
JTypeParamDef |
ImplJTypeParamDef._super(JType type) |
JComment |
JMethodDef._throws(JType type)
Get a
@throws doc comment block. |
JHtmlComment |
JDocComment._throws(JType exceptionType)
Add a
@throws tag. |
JComment |
AnnotationJMethodDef._throws(JType type) |
JComment |
AbstractJMethodDef._throws(JType type) |
JHtmlComment |
AbstractJDocComment._throws(JType exceptionType) |
JAnnotation |
ImplJAnonymousClassDef.annotate(JType type) |
JAnnotation |
JAnnotatable.annotate(JType type)
Add an annotation.
|
JAnnotation |
SuccessorJVarDeclaration.annotate(JType type) |
JAnnotation |
BasicJAnnotatable.annotate(JType type) |
JAnnotationArray |
JAnnotation.annotationArrayValue(JType type)
Set the "value" property of this annotation to an array of nested annotations of the given type.
|
JAnnotationArray |
ImplJAnnotation.annotationArrayValue(JType type) |
JAnnotationArray |
JAnnotation.annotationArrayValue(java.lang.String name,
JType type)
Set the named property of this annotation to an array of nested annotations of the given type.
|
JAnnotationArray |
ImplJAnnotation.annotationArrayValue(java.lang.String name,
JType type) |
JAnnotation |
JAnnotation.annotationValue(JType type)
Set the "value" property of this annotation to a nested annotation of the given type.
|
JAnnotation |
ImplJAnnotation.annotationValue(JType type) |
JAnnotation |
JAnnotation.annotationValue(java.lang.String name,
JType type)
Set the named property of this annotation to a nested annotation of the given type.
|
JAnnotation |
ImplJAnnotation.annotationValue(java.lang.String name,
JType type) |
JCall |
BasicJBlock.callStatic(JType type,
java.lang.String name) |
static JCall |
JExprs.callStatic(JType type,
java.lang.String name)
Generate a method call expression to a method on the given static type.
|
JCall |
JBlock.callStatic(JType type,
java.lang.String name)
Insert a type-qualified static method invocation at this point.
|
JExpr |
AbstractJExpr.cast(JType type) |
JExpr |
JExpr.cast(JType type)
Get an expression which is a cast of this expression to the given type.
|
private static JType[] |
NarrowedJType.concat(JType[] a,
JType[] b) |
private static JType[] |
NarrowedJType.concat(JType[] a,
JType[] b) |
JVarDeclaration |
Sectionable.field(java.util.ArrayList<ClassContent> content,
int mods,
JType type,
java.lang.String name,
JExpr init) |
JVarDeclaration |
AbstractJClassDef.field(java.util.ArrayList<ClassContent> content,
int mods,
JType type,
java.lang.String name,
JExpr init) |
JVarDeclaration |
ImplJAnonymousClassDef.field(int mods,
JType type,
java.lang.String name) |
JVarDeclaration |
AbstractJClassDef.field(int mods,
JType type,
java.lang.String name) |
JVarDeclaration |
JClassDefSection.field(int mods,
JType type,
java.lang.String name)
Add a field to this type.
|
JVarDeclaration |
JClassDefSectionImpl.field(int mods,
JType type,
java.lang.String name) |
JVarDeclaration |
ImplJAnonymousClassDef.field(int mods,
JType type,
java.lang.String name,
JExpr init) |
JVarDeclaration |
AbstractJClassDef.field(int mods,
JType type,
java.lang.String name,
JExpr init) |
JVarDeclaration |
JClassDefSection.field(int mods,
JType type,
java.lang.String name,
JExpr init)
Add a field to this type.
|
JVarDeclaration |
JClassDefSectionImpl.field(int mods,
JType type,
java.lang.String name,
JExpr init) |
JBlock |
BasicJBlock.forEach(int mods,
JType type,
java.lang.String name,
JExpr iterable) |
JBlock |
JBlock.forEach(int mods,
JType type,
java.lang.String name,
JExpr iterable)
Insert a "for-each" style
for loop at this point. |
(package private) boolean |
ImplJSourceFile.hasImport(JType type,
SourceFileWriter writer) |
JTry |
ImplJTry.ignore(JType type) |
JTry |
ImplJCatch.ignore(JType type) |
JTry |
JTry.ignore(JType type)
Add a
catch for an ignored exception. |
JSourceFile |
ImplJSourceFile.importStatic(JType type,
java.lang.String member) |
JSourceFile |
JSourceFile.importStatic(JType type,
java.lang.String member)
Add a static member import to this source file.
|
JVarDeclaration |
ForJBlock.init(int mods,
JType type,
java.lang.String name,
JExpr value) |
JVarDeclaration |
JFor.init(int mods,
JType type,
java.lang.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 |
AbstractJComment.linkConstructor(boolean plain,
JType targetType,
JType... params) |
JComment |
AbstractJComment.linkConstructor(boolean plain,
JType targetType,
JType... params) |
JComment |
JComment.linkField(boolean plain,
JType targetType,
java.lang.String targetField)
Add an inline
@link to a field of a type. |
JComment |
AbstractJComment.linkField(boolean plain,
JType targetType,
java.lang.String targetField) |
JComment |
JComment.linkMethod(boolean plain,
JType targetType,
java.lang.String targetMethod,
JType... targetMethodArgumentTypes)
Add an inline
@link to a method. |
JComment |
JComment.linkMethod(boolean plain,
JType targetType,
java.lang.String targetMethod,
JType... targetMethodArgumentTypes)
Add an inline
@link to a method. |
JComment |
AbstractJComment.linkMethod(boolean plain,
JType targetType,
java.lang.String targetMethod,
JType... params) |
JComment |
AbstractJComment.linkMethod(boolean plain,
JType targetType,
java.lang.String targetMethod,
JType... params) |
JComment |
JComment.linkType(boolean plain,
JType targetType)
Add an inline
@link to a type. |
JComment |
AbstractJComment.linkType(boolean plain,
JType targetType) |
JMethodDef |
Sectionable.method(java.util.ArrayList<ClassContent> content,
int mods,
JType returnType,
java.lang.String name) |
JMethodDef |
AnnotationJClassDef.method(java.util.ArrayList<ClassContent> content,
int mods,
JType returnType,
java.lang.String name) |
JMethodDef |
AbstractJClassDef.method(java.util.ArrayList<ClassContent> content,
int mods,
JType returnType,
java.lang.String name) |
JMethodDef |
ImplJAnonymousClassDef.method(int mods,
JType returnType,
java.lang.String name) |
JMethodDef |
AbstractJClassDef.method(int mods,
JType returnType,
java.lang.String name) |
JMethodDef |
JClassDefSection.method(int mods,
JType returnType,
java.lang.String name)
Add a method to this type.
|
JMethodDef |
JClassDefSectionImpl.method(int mods,
JType returnType,
java.lang.String name) |
(package private) static ReferenceJType |
ReferenceJType.of(JType type) |
(package private) static AbstractJType |
AbstractJType.of(JType type) |
JCatch |
JCatch.or(JType orType)
Add another type option to this catch branch.
|
JCatch |
ImplJCatch.or(JType orType) |
JParamDeclaration |
JMethodDef.param(int mods,
JType type,
java.lang.String name)
Add a parameter to this method.
|
JParamDeclaration |
AnnotationJMethodDef.param(int mods,
JType type,
java.lang.String name) |
JParamDeclaration |
AbstractJMethodDef.param(int mods,
JType type,
java.lang.String name) |
JParamDeclaration |
JMethodDef.param(JType type,
java.lang.String name)
Add a parameter to this method.
|
JLambda |
JLambda.param(JType type,
java.lang.String name)
Add a declared-type parameter to this lambda.
|
JParamDeclaration |
AbstractJMethodDef.param(JType type,
java.lang.String name) |
JLambda |
JLambdaImpl.param(JType type,
java.lang.String name) |
JExpr |
BasicJBlock.tempVar(JType type,
JExpr value) |
JExpr |
JBlock.tempVar(JType type,
JExpr value)
Insert a local variable declaration at this point with a generated name.
|
JType |
ReferenceJType.typeArg(JType... args) |
JType |
AbstractJType.typeArg(JType... args) |
JType |
NestedJType.typeArg(JType... args) |
JType |
NarrowedJType.typeArg(JType... args) |
JType |
JType.typeArg(JType... args)
This type, with the given generic type arguments.
|
JCall |
DirectJCall.typeArg(JType type) |
JCall |
AbstractJCall.typeArg(JType type) |
JCall |
JCall.typeArg(JType type)
Add a type argument to this call.
|
JDocComment |
JDocComment.typeName(JType type)
Add a type name to the end of this comment.
|
JComment |
JComment.typeName(JType type)
Add a type name to the end of this comment.
|
JHtmlComment |
AbstractJHtmlComment.typeName(JType type) |
JDocComment |
AbstractJDocComment.typeName(JType type) |
JHtmlComment |
JHtmlComment.typeName(JType type)
Add a type name to the end of this comment.
|
JComment |
AbstractJComment.typeName(JType type) |
JDocComment |
JDocComment.value(JType type,
java.lang.String fieldName)
Add a
@value inline tag. |
JHtmlComment |
AbstractJHtmlComment.value(JType type,
java.lang.String fieldName) |
JDocComment |
AbstractJDocComment.value(JType type,
java.lang.String fieldName) |
JHtmlComment |
JHtmlComment.value(JType type,
java.lang.String fieldName)
Add a
@value inline tag. |
JVarDeclaration |
BasicJBlock.var(int mods,
JType type,
java.lang.String name) |
JVarDeclaration |
JBlock.var(int mods,
JType type,
java.lang.String name)
Insert a local variable declaration at this point.
|
JVarDeclaration |
BasicJBlock.var(int mods,
JType type,
java.lang.String name,
JExpr value) |
JVarDeclaration |
JBlock.var(int mods,
JType type,
java.lang.String name,
JExpr value)
Insert a local variable declaration at this point.
|
JParamDeclaration |
JMethodDef.varargParam(int mods,
JType type,
java.lang.String name)
Add a vararg parameter to this method.
|
JParamDeclaration |
AnnotationJMethodDef.varargParam(int mods,
JType type,
java.lang.String name) |
JParamDeclaration |
AbstractJMethodDef.varargParam(int mods,
JType type,
java.lang.String name) |
JParamDeclaration |
JMethodDef.varargParam(JType type,
java.lang.String name)
Add a vararg parameter to this method.
|
JParamDeclaration |
AbstractJMethodDef.varargParam(JType type,
java.lang.String name) |
JVarDeclaration |
ImplJTry.with(int mods,
JType type,
java.lang.String var,
JExpr init) |
JVarDeclaration |
ImplJCatch.with(int mods,
JType type,
java.lang.String var,
JExpr init) |
JVarDeclaration |
JTry.with(int mods,
JType type,
java.lang.String var,
JExpr init)
Add a resource for
try -with-resources constructs. |
(package private) void |
SourceFileWriter.write(JType type) |
Modifier and Type | Method and Description |
---|---|
private void |
ImplJTypeParamDef.writeList(SourceFileWriter sourceFileWriter,
java.util.ArrayList<JType> list,
Tokens.$KW keyword) |
Constructor and Description |
---|
AnnotationJMethodDef(AbstractJClassDef enclosingClass,
int mods,
JType returnType,
java.lang.String name) |
CastJExpr(AbstractJExpr expr,
JType type) |
FirstJVarDeclaration(int mods,
JType type,
java.lang.String name,
JExpr value) |
ForEachJBlock(BasicJBlock parent,
int mods,
JType type,
java.lang.String name,
JExpr iterable) |
ImplJAnnotation(JType type) |
ImplJAnnotationArray(JType type) |
ImplJAnonymousClassDef(JType type) |
ImplJCatch(ImplJTry _try,
int mods,
JType type,
java.lang.String var) |
ImplJParamDeclaration(int mods,
JType type,
java.lang.String name) |
InnerJAnonymousClassDef(AbstractJExpr expr,
JType type) |
InnerNewJCall(AbstractJExpr target,
JType type) |
InstanceOfJExpr(AbstractJExpr expr,
JType type) |
JTypeCommentContent(JType type) |
MethodJMethodDef(AbstractJClassDef clazz,
int mods,
JType returnType,
java.lang.String name) |
NarrowedJType(AbstractJType erased,
JType[] args) |
Param(JType type,
java.lang.String name) |
StaticJCall(JType type,
java.lang.String name) |
TryJVarDeclaration(int mods,
JType type,
java.lang.String name,
JExpr value,
ImplJTry owner) |