Package org.jboss.jdeparser
Class ImplJAnonymousClassDef
- java.lang.Object
-
- org.jboss.jdeparser.AbstractJExpr
-
- org.jboss.jdeparser.AbstractJCall
-
- org.jboss.jdeparser.ImplJAnonymousClassDef
-
- All Implemented Interfaces:
AllowedStatementExpression,JAnnotatable,JAnonymousClassDef,JCall,JClassDef,JClassDefSection,JCommentable,JDocCommentable,JExpr,JGenericDef,JSimpleArgs,Writable
- Direct Known Subclasses:
InnerJAnonymousClassDef
class ImplJAnonymousClassDef extends AbstractJCall implements JAnonymousClassDef
-
-
Constructor Summary
Constructors Constructor Description ImplJAnonymousClassDef(JType type)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method 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 anextendstype to this type.JClassDef_extends(java.lang.String name)Add anextendstype to this type.JClassDef_extends(JType type)Add anextendstype to this type.JClassDef_implements(java.lang.Class<?>... classes)Add one or moreimplementstype(s) to this type.JClassDef_implements(java.lang.String... names)Add one or moreimplementstype(s) to this type.JClassDef_implements(JType... types)Add one or moreimplementstype(s) to this type.JClassDef_interface(int mods, java.lang.String name)Add a nested interface to this type.JAnnotationannotate(java.lang.Class<? extends java.lang.annotation.Annotation> type)Add an annotation.JAnnotationannotate(java.lang.String type)Add an annotation.JAnnotationannotate(JType type)Add an annotation.JClassDefannotationInterface(int mods, java.lang.String name)Add a nested annotation interface to this type.JClassDefblankLine()Add a blank line at this point of the type.JCommentblockComment()Add a block comment.JMethodDefconstructor(int mods)Add a constructor to this type.JCommentdeprecated()Mark this program element as deprecated.JDocCommentdocComment()Get or create the doc comment for this element.JTypeerasedType()Get the erased type corresponding to this type definition.JVarDeclarationfield(int mods, java.lang.Class<?> type, java.lang.String name)Add a field to this type.JVarDeclarationfield(int mods, java.lang.Class<?> type, java.lang.String name, JExpr init)Add a field to this type.JVarDeclarationfield(int mods, java.lang.String type, java.lang.String name)Add a field to this type.JVarDeclarationfield(int mods, java.lang.String type, java.lang.String name, JExpr init)Add a field to this type.JVarDeclarationfield(int mods, JType type, java.lang.String name)Add a field to this type.JVarDeclarationfield(int mods, JType type, java.lang.String name, JExpr init)Add a field to this type.JTypegenericType()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).JBlockinit()Add a "raw" initialization block to this type definition.JCommentlineComment()Add a line comment.JMethodDefmethod(int mods, java.lang.Class<?> returnType, java.lang.String name)Add a method to this type.JMethodDefmethod(int mods, java.lang.String returnType, java.lang.String name)Add a method to this type.JMethodDefmethod(int mods, JType returnType, java.lang.String name)Add a method to this type.JClassDefSectionsection()Create a section at this point, into which additional items may be added.JBlockstaticInit()Add a static initialization block to this type definition.JTypetype()JTypeParamDeftypeParam(java.lang.String name)Define a type parameter.JTypeParamDef[]typeParams()Get all the type parameters defined at the time of invocation.voidwrite(SourceFileWriter writer)-
Methods inherited from class org.jboss.jdeparser.AbstractJCall
arg, arguments, diamond, typeArg, typeArg, typeArg, typeArguments, writeTypeArgs
-
Methods inherited from class org.jboss.jdeparser.AbstractJExpr
_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, times
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.jboss.jdeparser.JCall
arg, arguments, diamond, typeArg, typeArg, typeArg, typeArguments
-
Methods inherited from interface org.jboss.jdeparser.JExpr
_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, times
-
-
-
-
Field Detail
-
classDef
private final AnonymousJClassDef classDef
-
type
private final JType type
-
-
Constructor Detail
-
ImplJAnonymousClassDef
ImplJAnonymousClassDef(JType type)
-
-
Method Detail
-
type
public JType type()
-
write
public void write(SourceFileWriter writer) throws java.io.IOException
- Specified by:
writein interfaceWritable- Overrides:
writein classAbstractJCall- Throws:
java.io.IOException
-
section
public JClassDefSection section()
Description copied from interface:JClassDefSectionCreate a section at this point, into which additional items may be added.- Specified by:
sectionin interfaceJClassDefSection- Returns:
- the new section to add
-
_extends
public JClassDef _extends(java.lang.String name)
Description copied from interface:JClassDefAdd anextendstype to this type.
-
_extends
public JClassDef _extends(JType type)
Description copied from interface:JClassDefAdd anextendstype to this type.
-
_extends
public JClassDef _extends(java.lang.Class<?> clazz)
Description copied from interface:JClassDefAdd anextendstype to this type.
-
_implements
public JClassDef _implements(java.lang.String... names)
Description copied from interface:JClassDefAdd one or moreimplementstype(s) to this type.- Specified by:
_implementsin interfaceJClassDef- Parameters:
names- the type name- Returns:
- this type definition
-
_implements
public JClassDef _implements(JType... types)
Description copied from interface:JClassDefAdd one or moreimplementstype(s) to this type.- Specified by:
_implementsin interfaceJClassDef- Parameters:
types- the type- Returns:
- this type definition
-
_implements
public JClassDef _implements(java.lang.Class<?>... classes)
Description copied from interface:JClassDefAdd one or moreimplementstype(s) to this type.- Specified by:
_implementsin interfaceJClassDef- Parameters:
classes- the type- Returns:
- this type definition
-
erasedType
public JType erasedType()
Description copied from interface:JClassDefGet the erased type corresponding to this type definition.- Specified by:
erasedTypein interfaceJClassDef- Returns:
- the erased type
-
blankLine
public JClassDef blankLine()
Description copied from interface:JClassDefAdd a blank line at this point of the type.- Specified by:
blankLinein interfaceJClassDef- Specified by:
blankLinein interfaceJClassDefSection- Returns:
- this type definition
-
genericType
public JType genericType()
Description copied from interface:JClassDefGet 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).- Specified by:
genericTypein interfaceJClassDef- Returns:
- the generic type
-
typeParam
public JTypeParamDef typeParam(java.lang.String name)
Description copied from interface:JGenericDefDefine a type parameter.- Specified by:
typeParamin interfaceJGenericDef- Parameters:
name- the type parameter name- Returns:
- the type parameter definition
-
init
public JBlock init()
Description copied from interface:JClassDefSectionAdd a "raw" initialization block to this type definition.- Specified by:
initin interfaceJClassDefSection- Returns:
- the initialization block
-
staticInit
public JBlock staticInit()
Description copied from interface:JClassDefSectionAdd a static initialization block to this type definition.- Specified by:
staticInitin interfaceJClassDefSection- Returns:
- the static initialization block
-
_enum
public JEnumConstant _enum(java.lang.String name)
Description copied from interface:JClassDefAdd an enum constant. If the class being defined is not an enum, an exception is thrown.
-
field
public JVarDeclaration field(int mods, JType type, java.lang.String name)
Description copied from interface:JClassDefSectionAdd a field to this type.- Specified by:
fieldin interfaceJClassDefSection- Parameters:
mods- the modifierstype- the field typename- the field name- Returns:
- the field declaration
-
field
public JVarDeclaration field(int mods, JType type, java.lang.String name, JExpr init)
Description copied from interface:JClassDefSectionAdd a field to this type.- Specified by:
fieldin interfaceJClassDefSection- Parameters:
mods- the modifierstype- the field typename- the field nameinit- the field assigned value- Returns:
- the field declaration
-
field
public JVarDeclaration field(int mods, java.lang.Class<?> type, java.lang.String name)
Description copied from interface:JClassDefSectionAdd a field to this type.- Specified by:
fieldin interfaceJClassDefSection- Parameters:
mods- the modifierstype- the field typename- the field name- Returns:
- the field declaration
-
field
public JVarDeclaration field(int mods, java.lang.Class<?> type, java.lang.String name, JExpr init)
Description copied from interface:JClassDefSectionAdd a field to this type.- Specified by:
fieldin interfaceJClassDefSection- Parameters:
mods- the modifierstype- the field typename- the field nameinit- the field assigned value- Returns:
- the field declaration
-
field
public JVarDeclaration field(int mods, java.lang.String type, java.lang.String name)
Description copied from interface:JClassDefSectionAdd a field to this type.- Specified by:
fieldin interfaceJClassDefSection- Parameters:
mods- the modifierstype- the field typename- the field name- Returns:
- the field declaration
-
field
public JVarDeclaration field(int mods, java.lang.String type, java.lang.String name, JExpr init)
Description copied from interface:JClassDefSectionAdd a field to this type.- Specified by:
fieldin interfaceJClassDefSection- Parameters:
mods- the modifierstype- the field typename- the field nameinit- the field assigned value- Returns:
- the field declaration
-
method
public JMethodDef method(int mods, JType returnType, java.lang.String name)
Description copied from interface:JClassDefSectionAdd a method to this type.- Specified by:
methodin interfaceJClassDefSection- Parameters:
mods- the modifiersreturnType- the method return typename- the method name- Returns:
- the method definition
-
method
public JMethodDef method(int mods, java.lang.Class<?> returnType, java.lang.String name)
Description copied from interface:JClassDefSectionAdd a method to this type.- Specified by:
methodin interfaceJClassDefSection- Parameters:
mods- the modifiersreturnType- the method return typename- the method name- Returns:
- the method definition
-
method
public JMethodDef method(int mods, java.lang.String returnType, java.lang.String name)
Description copied from interface:JClassDefSectionAdd a method to this type.- Specified by:
methodin interfaceJClassDefSection- Parameters:
mods- the modifiersreturnType- the method return typename- the method name- Returns:
- the method definition
-
constructor
public JMethodDef constructor(int mods)
Description copied from interface:JClassDefSectionAdd a constructor to this type.- Specified by:
constructorin interfaceJClassDefSection- Parameters:
mods- the modifiers- Returns:
- the constructor definition
-
typeParams
public JTypeParamDef[] typeParams()
Description copied from interface:JGenericDefGet all the type parameters defined at the time of invocation.- Specified by:
typeParamsin interfaceJGenericDef- Returns:
- the type parameters
-
annotate
public JAnnotation annotate(java.lang.String type)
Description copied from interface:JAnnotatableAdd an annotation.- Specified by:
annotatein interfaceJAnnotatable- Parameters:
type- the type of the annotation to add- Returns:
- the new annotation
-
annotate
public JAnnotation annotate(JType type)
Description copied from interface:JAnnotatableAdd an annotation.- Specified by:
annotatein interfaceJAnnotatable- Parameters:
type- the type of the annotation to add- Returns:
- the new annotation
-
annotate
public JAnnotation annotate(java.lang.Class<? extends java.lang.annotation.Annotation> type)
Description copied from interface:JAnnotatableAdd an annotation.- Specified by:
annotatein interfaceJAnnotatable- Parameters:
type- the type of the annotation to add- Returns:
- the new annotation
-
docComment
public JDocComment docComment()
Description copied from interface:JDocCommentableGet or create the doc comment for this element.- Specified by:
docCommentin interfaceJDocCommentable- Returns:
- the doc comment body
-
deprecated
public JComment deprecated()
Description copied from interface:JDocCommentableMark this program element as deprecated.- Specified by:
deprecatedin interfaceJDocCommentable- Returns:
- the deprecation tag body
-
lineComment
public JComment lineComment()
Description copied from interface:JCommentableAdd a line comment.- Specified by:
lineCommentin interfaceJCommentable- Overrides:
lineCommentin classAbstractJCall- Returns:
- the line comment body
-
blockComment
public JComment blockComment()
Description copied from interface:JCommentableAdd a block comment.- Specified by:
blockCommentin interfaceJCommentable- Overrides:
blockCommentin classAbstractJCall- Returns:
- the block comment body
-
_class
public JClassDef _class(int mods, java.lang.String name)
Description copied from interface:JClassDefSectionAdd a nested class to this type.- Specified by:
_classin interfaceJClassDefSection- Parameters:
mods- the class modifiersname- the class name- Returns:
- the nested class
-
_enum
public JClassDef _enum(int mods, java.lang.String name)
Description copied from interface:JClassDefSectionAdd a nested enum to this type.- Specified by:
_enumin interfaceJClassDefSection- Parameters:
mods- the enum modifiersname- the enum name- Returns:
- the nested enum
-
_interface
public JClassDef _interface(int mods, java.lang.String name)
Description copied from interface:JClassDefSectionAdd a nested interface to this type.- Specified by:
_interfacein interfaceJClassDefSection- Parameters:
mods- the interface modifiersname- the interface name- Returns:
- the nested interface
-
annotationInterface
public JClassDef annotationInterface(int mods, java.lang.String name)
Description copied from interface:JClassDefSectionAdd a nested annotation interface to this type.- Specified by:
annotationInterfacein interfaceJClassDefSection- Parameters:
mods- the annotation interface modifiersname- the annotation interface name- Returns:
- the nested annotation interface
-
-