Class AbstractJClassDef
java.lang.Object
org.jboss.jdeparser.BasicJCommentable
org.jboss.jdeparser.AbstractJDocCommentable
org.jboss.jdeparser.BasicJAnnotatable
org.jboss.jdeparser.AbstractJGeneric
org.jboss.jdeparser.AbstractJClassDef
- All Implemented Interfaces:
ClassContent, ClassFileContent, JAnnotatable, JClassDef, JClassDefSection, JCommentable, JDocCommentable, JGenericDef, Sectionable, Writable
- Direct Known Subclasses:
AnnotationJClassDef, AnonymousJClassDef, EnumConstantJClassDef, EnumJClassDef, InterfaceJClassDef, PlainJClassDef
abstract class AbstractJClassDef
extends AbstractJGeneric
implements JClassDef, ClassFileContent, ClassContent, Sectionable
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate JTypeprivate final ImplJSourceFileprivate final ArrayList<ClassContent> private final AbstractJClassDefprivate JTypeprivate JTypeprivate final intprivate final String -
Constructor Summary
ConstructorsConstructorDescriptionAbstractJClassDef(int mods, String name) AbstractJClassDef(int mods, AbstractJClassDef enclosingClass, String name) AbstractJClassDef(int mods, ImplJSourceFile classFile, String name) -
Method Summary
Modifier and TypeMethodDescriptionfinal JClassDefAdd a nested class to this type._class(ArrayList<ClassContent> content, int mods, String name) final JClassDefAdd a nested enum to this type.Add an enum constant._enum(ArrayList<ClassContent> content, int mods, String name) Add anextendstype to this type.Add anextendstype to this type.Add anextendstype to this type._implements(Class<?>... classes) Add one or moreimplementstype(s) to this type._implements(String... names) Add one or moreimplementstype(s) to this type._implements(JType... types) Add one or moreimplementstype(s) to this type.final JClassDef_interface(int mods, String name) Add a nested interface to this type._interface(ArrayList<ClassContent> content, int mods, String name) (package private) <C extends ClassContent>
Cadd(C item) (package private) <C extends ClassContent>
Cadd(ArrayList<ClassContent> content, C item) final JClassDefannotationInterface(int mods, String name) Add a nested annotation interface to this type.annotationInterface(ArrayList<ClassContent> content, int mods, String name) Add a blank line at this point of the type.Add a block comment.final JMethodDefconstructor(int mods) Add a constructor to this type.constructor(ArrayList<ClassContent> content, int mods) (package private) abstract Tokens.$KWGet the erased type corresponding to this type definition.final JVarDeclarationAdd a field to this type.final JVarDeclarationAdd a field to this type.final JVarDeclarationAdd a field to this type.final JVarDeclarationAdd a field to this type.final JVarDeclarationAdd a field to this type.final JVarDeclarationAdd a field to this type.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).(package private) ImplJSourceFile(package private) Iterable<ClassContent> (package private) AbstractJClassDef(package private) JType(package private) FormatPreferences.Indentationint(package private) intgetMods()(package private) StringgetName()booleanhasAllModifiers(int mods) booleanhasAnyModifier(int mods) (package private) booleanfinal JBlockinit()Add a "raw" initialization block to this type definition.init(ArrayList<ClassContent> content) Add a line comment.final JMethodDefAdd a method to this type.final JMethodDefAdd a method to this type.final JMethodDefAdd a method to this type.method(ArrayList<ClassContent> content, int mods, JType returnType, String name) (package private) booleanmethodCanHaveBody(int mods) section()Create a section at this point, into which additional items may be added.final JBlockAdd a static initialization block to this type definition.staticInit(ArrayList<ClassContent> content) (package private) booleanDefine a type parameter.voidwrite(SourceFileWriter writer) (package private) voidwriteClassHeader(SourceFileWriter sourceFileWriter) (package private) voidwriteContent(SourceFileWriter sourceFileWriter) (package private) voidwriteContentBlock(SourceFileWriter sourceFileWriter) Methods inherited from class AbstractJGeneric
typeParams, typeParamsToArgs, writeTypeParamsMethods inherited from class BasicJAnnotatable
annotate, annotate, annotate, writeAnnotationsMethods inherited from class AbstractJDocCommentable
deprecated, docComment, writeDocCommentsMethods inherited from class BasicJCommentable
writeCommentsMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface JAnnotatable
annotate, annotate, annotateMethods inherited from interface JDocCommentable
deprecated, docCommentMethods inherited from interface JGenericDef
typeParams
-
Field Details
-
mods
private final int mods -
name
-
enclosingClass
-
classFile
-
-
_extends
-
_implements
-
erased
-
generic
-
-
Constructor Details
-
AbstractJClassDef
AbstractJClassDef(int mods, String name) -
AbstractJClassDef
AbstractJClassDef(int mods, AbstractJClassDef enclosingClass, String name) -
AbstractJClassDef
AbstractJClassDef(int mods, ImplJSourceFile classFile, String name)
-
-
Method Details
-
getEnclosingClass
AbstractJClassDef getEnclosingClass() -
getClassFile
ImplJSourceFile getClassFile() -
getMods
int getMods() -
getName
String getName() -
add
-
add
-
lineComment
Description copied from interface:JCommentableAdd a line comment.- Specified by:
lineCommentin interfaceJCommentable- Overrides:
lineCommentin classBasicJCommentable- Returns:
- the line comment body
-
blockComment
Description copied from interface:JCommentableAdd a block comment.- Specified by:
blockCommentin interfaceJCommentable- Overrides:
blockCommentin classBasicJCommentable- Returns:
- the block comment body
-
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
-
_extends
-
_extends
-
_implements
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
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
Description copied from interface:JClassDefAdd one or moreimplementstype(s) to this type.- Specified by:
_implementsin interfaceJClassDef- Parameters:
classes- the type- Returns:
- this type definition
-
blankLine
-
erasedType
Description copied from interface:JClassDefGet the erased type corresponding to this type definition.- Specified by:
erasedTypein interfaceJClassDef- Returns:
- the erased type
-
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
Description copied from interface:JGenericDefDefine a type parameter.- Specified by:
typeParamin interfaceJGenericDef- Overrides:
typeParamin classAbstractJGeneric- Parameters:
name- the type parameter name- Returns:
- the type parameter definition
-
init
Description copied from interface:JClassDefSectionAdd a "raw" initialization block to this type definition.- Specified by:
initin interfaceJClassDefSection- Returns:
- the initialization block
-
init
- Specified by:
initin interfaceSectionable
-
staticInit
Description copied from interface:JClassDefSectionAdd a static initialization block to this type definition.- Specified by:
staticInitin interfaceJClassDefSection- Returns:
- the static initialization block
-
staticInit
- Specified by:
staticInitin interfaceSectionable
-
_enum
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(ArrayList<ClassContent> content, int mods, JType type, String name, JExpr init) - Specified by:
fieldin interfaceSectionable
-
field
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
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
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
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
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
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
- Specified by:
methodin interfaceSectionable
-
method
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
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
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
-
methodCanHaveBody
boolean methodCanHaveBody(int mods) -
hasInterfaceStyleExtends
boolean hasInterfaceStyleExtends() -
supportsCompactInitOnly
boolean supportsCompactInitOnly() -
constructor
- Specified by:
constructorin interfaceSectionable
-
constructor
Description copied from interface:JClassDefSectionAdd a constructor to this type.- Specified by:
constructorin interfaceJClassDefSection- Parameters:
mods- the modifiers- Returns:
- the constructor definition
-
_class
- Specified by:
_classin interfaceSectionable
-
_enum
- Specified by:
_enumin interfaceSectionable
-
_interface
- Specified by:
_interfacein interfaceSectionable
-
annotationInterface
- Specified by:
annotationInterfacein interfaceSectionable
-
_class
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
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
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
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
-
getContent
Iterable<ClassContent> getContent() -
getExtends
JType getExtends() -
getImplements
-
designation
-
getMemberIndentation
FormatPreferences.Indentation getMemberIndentation() -
write
- Specified by:
writein interfaceWritable- Throws:
IOException
-
writeContentBlock
- Throws:
IOException
-
writeClassHeader
- Throws:
IOException
-
writeContent
- Throws:
IOException
-
getModifiers
public int getModifiers() -
hasAllModifiers
public boolean hasAllModifiers(int mods) -
hasAnyModifier
public boolean hasAnyModifier(int mods)
-