class ImplJAnonymousClassDef extends AbstractJCall implements JAnonymousClassDef
| Modifier and Type | Field and Description |
|---|---|
private AnonymousJClassDef |
classDef |
private JType |
type |
| Constructor and Description |
|---|
ImplJAnonymousClassDef(JType type) |
| Modifier and Type | Method and Description |
|---|---|
JClassDef |
_class(int mods,
java.lang.String name)
Add a nested class to this type.
|
JClassDef |
_enum(int mods,
java.lang.String name)
Add a nested enum to this type.
|
JEnumConstant |
_enum(java.lang.String name)
Add an enum constant.
|
JClassDef |
_extends(java.lang.Class<?> clazz)
Add an
extends type to this type. |
JClassDef |
_extends(JType type)
Add an
extends type to this type. |
JClassDef |
_extends(java.lang.String name)
Add an
extends type to this type. |
JClassDef |
_implements(java.lang.Class<?>... classes)
Add one or more
implements type(s) to this type. |
JClassDef |
_implements(JType... types)
Add one or more
implements type(s) to this type. |
JClassDef |
_implements(java.lang.String... names)
Add one or more
implements type(s) to this type. |
JClassDef |
_interface(int mods,
java.lang.String name)
Add a nested interface to this type.
|
JAnnotation |
annotate(java.lang.Class<? extends java.lang.annotation.Annotation> type)
Add an annotation.
|
JAnnotation |
annotate(JType type)
Add an annotation.
|
JAnnotation |
annotate(java.lang.String type)
Add an annotation.
|
JClassDef |
annotationInterface(int mods,
java.lang.String name)
Add a nested annotation interface to this type.
|
JClassDef |
blankLine()
Add a blank line at this point of the type.
|
JComment |
blockComment()
Add a block comment.
|
JMethodDef |
constructor(int mods)
Add a constructor to this type.
|
JComment |
deprecated()
Mark this program element as deprecated.
|
JDocComment |
docComment()
Get or create the doc comment for this element.
|
JType |
erasedType()
Get the erased type corresponding to this type definition.
|
JVarDeclaration |
field(int mods,
java.lang.Class<?> type,
java.lang.String name)
Add a field to this type.
|
JVarDeclaration |
field(int mods,
java.lang.Class<?> type,
java.lang.String name,
JExpr init)
Add a field to this type.
|
JVarDeclaration |
field(int mods,
JType type,
java.lang.String name)
Add a field to this type.
|
JVarDeclaration |
field(int mods,
JType type,
java.lang.String name,
JExpr init)
Add a field to this type.
|
JVarDeclaration |
field(int mods,
java.lang.String type,
java.lang.String name)
Add a field to this type.
|
JVarDeclaration |
field(int mods,
java.lang.String type,
java.lang.String name,
JExpr init)
Add a field to this type.
|
JType |
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).
|
JBlock |
init()
Add a "raw" initialization block to this type definition.
|
JComment |
lineComment()
Add a line comment.
|
JMethodDef |
method(int mods,
java.lang.Class<?> returnType,
java.lang.String name)
Add a method to this type.
|
JMethodDef |
method(int mods,
JType returnType,
java.lang.String name)
Add a method to this type.
|
JMethodDef |
method(int mods,
java.lang.String returnType,
java.lang.String name)
Add a method to this type.
|
JClassDefSection |
section()
Create a section at this point, into which additional items may be added.
|
JBlock |
staticInit()
Add a static initialization block to this type definition.
|
JType |
type() |
JTypeParamDef |
typeParam(java.lang.String name)
Define a type parameter.
|
JTypeParamDef[] |
typeParams()
Get all the type parameters defined at the time of invocation.
|
void |
write(SourceFileWriter writer) |
arg, arguments, diamond, typeArg, typeArg, typeArg, typeArguments, writeTypeArgs_instanceof, _instanceof, _instanceof, _new, _new, _new, _newAnon, _newAnon, _newAnon, $v, and, band, bor, bxor, call, cast, cast, cast, comp, cond, div, eq, field, ge, gt, idx, idx, le, length, lshr, lt, minus, mod, ne, neg, not, of, or, paren, plus, prec, shl, shr, timesclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitarg, arguments, diamond, typeArg, typeArg, typeArg, typeArguments_instanceof, _instanceof, _instanceof, _new, _new, _new, _newAnon, _newAnon, _newAnon, $v, and, band, bor, bxor, call, cast, cast, cast, comp, cond, div, eq, field, ge, gt, idx, idx, le, length, lshr, lt, minus, mod, ne, neg, not, or, paren, plus, shl, shr, timesprivate final AnonymousJClassDef classDef
private final JType type
ImplJAnonymousClassDef(JType type)
public JType type()
public void write(SourceFileWriter writer) throws java.io.IOException
write in interface Writablewrite in class AbstractJCalljava.io.IOExceptionpublic JClassDefSection section()
JClassDefSectionsection in interface JClassDefSectionpublic JClassDef _extends(java.lang.String name)
JClassDefextends type to this type.public JClassDef _extends(JType type)
JClassDefextends type to this type.public JClassDef _extends(java.lang.Class<?> clazz)
JClassDefextends type to this type.public JClassDef _implements(java.lang.String... names)
JClassDefimplements type(s) to this type._implements in interface JClassDefnames - the type namepublic JClassDef _implements(JType... types)
JClassDefimplements type(s) to this type._implements in interface JClassDeftypes - the typepublic JClassDef _implements(java.lang.Class<?>... classes)
JClassDefimplements type(s) to this type._implements in interface JClassDefclasses - the typepublic JType erasedType()
JClassDeferasedType in interface JClassDefpublic JClassDef blankLine()
JClassDefblankLine in interface JClassDefblankLine in interface JClassDefSectionpublic JType genericType()
JClassDefgenericType in interface JClassDefpublic JTypeParamDef typeParam(java.lang.String name)
JGenericDeftypeParam in interface JGenericDefname - the type parameter namepublic JBlock init()
JClassDefSectioninit in interface JClassDefSectionpublic JBlock staticInit()
JClassDefSectionstaticInit in interface JClassDefSectionpublic JEnumConstant _enum(java.lang.String name)
JClassDefpublic JVarDeclaration field(int mods, JType type, java.lang.String name)
JClassDefSectionfield in interface JClassDefSectionmods - the modifierstype - the field typename - the field namepublic JVarDeclaration field(int mods, JType type, java.lang.String name, JExpr init)
JClassDefSectionfield in interface JClassDefSectionmods - the modifierstype - the field typename - the field nameinit - the field assigned valuepublic JVarDeclaration field(int mods, java.lang.Class<?> type, java.lang.String name)
JClassDefSectionfield in interface JClassDefSectionmods - the modifierstype - the field typename - the field namepublic JVarDeclaration field(int mods, java.lang.Class<?> type, java.lang.String name, JExpr init)
JClassDefSectionfield in interface JClassDefSectionmods - the modifierstype - the field typename - the field nameinit - the field assigned valuepublic JVarDeclaration field(int mods, java.lang.String type, java.lang.String name)
JClassDefSectionfield in interface JClassDefSectionmods - the modifierstype - the field typename - the field namepublic JVarDeclaration field(int mods, java.lang.String type, java.lang.String name, JExpr init)
JClassDefSectionfield in interface JClassDefSectionmods - the modifierstype - the field typename - the field nameinit - the field assigned valuepublic JMethodDef method(int mods, JType returnType, java.lang.String name)
JClassDefSectionmethod in interface JClassDefSectionmods - the modifiersreturnType - the method return typename - the method namepublic JMethodDef method(int mods, java.lang.Class<?> returnType, java.lang.String name)
JClassDefSectionmethod in interface JClassDefSectionmods - the modifiersreturnType - the method return typename - the method namepublic JMethodDef method(int mods, java.lang.String returnType, java.lang.String name)
JClassDefSectionmethod in interface JClassDefSectionmods - the modifiersreturnType - the method return typename - the method namepublic JMethodDef constructor(int mods)
JClassDefSectionconstructor in interface JClassDefSectionmods - the modifierspublic JTypeParamDef[] typeParams()
JGenericDeftypeParams in interface JGenericDefpublic JAnnotation annotate(java.lang.String type)
JAnnotatableannotate in interface JAnnotatabletype - the type of the annotation to addpublic JAnnotation annotate(JType type)
JAnnotatableannotate in interface JAnnotatabletype - the type of the annotation to addpublic JAnnotation annotate(java.lang.Class<? extends java.lang.annotation.Annotation> type)
JAnnotatableannotate in interface JAnnotatabletype - the type of the annotation to addpublic JDocComment docComment()
JDocCommentabledocComment in interface JDocCommentablepublic JComment deprecated()
JDocCommentabledeprecated in interface JDocCommentablepublic JComment lineComment()
JCommentablelineComment in interface JCommentablelineComment in class AbstractJCallpublic JComment blockComment()
JCommentableblockComment in interface JCommentableblockComment in class AbstractJCallpublic JClassDef _class(int mods, java.lang.String name)
JClassDefSection_class in interface JClassDefSectionmods - the class modifiersname - the class namepublic JClassDef _enum(int mods, java.lang.String name)
JClassDefSection_enum in interface JClassDefSectionmods - the enum modifiersname - the enum namepublic JClassDef _interface(int mods, java.lang.String name)
JClassDefSection_interface in interface JClassDefSectionmods - the interface modifiersname - the interface namepublic JClassDef annotationInterface(int mods, java.lang.String name)
JClassDefSectionannotationInterface in interface JClassDefSectionmods - the annotation interface modifiersname - the annotation interface name