Package org.jboss.jdeparser
Class JClassDefSectionImpl
- java.lang.Object
-
- org.jboss.jdeparser.JClassDefSectionImpl
-
- All Implemented Interfaces:
ClassContent,JClassDefSection,JCommentable,Writable
class JClassDefSectionImpl extends java.lang.Object implements JClassDefSection, ClassContent
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.ArrayList<ClassContent>contentprivate Sectionablesectionable
-
Constructor Summary
Constructors Constructor Description JClassDefSectionImpl(Sectionable sectionable)
-
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.JClassDef_interface(int mods, java.lang.String name)Add a nested interface to this type.(package private) <C extends ClassContent>
Cadd(C item)JClassDefannotationInterface(int mods, java.lang.String name)Add a nested annotation interface to this type.JClassDefSectionblankLine()Add a blank line at this point of the type.JCommentblockComment()Add a block comment.JMethodDefconstructor(int mods)Add a constructor to this type.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.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.voidwrite(SourceFileWriter writer)
-
-
-
Field Detail
-
sectionable
private final Sectionable sectionable
-
content
private final java.util.ArrayList<ClassContent> content
-
-
Constructor Detail
-
JClassDefSectionImpl
JClassDefSectionImpl(Sectionable sectionable)
-
-
Method Detail
-
add
<C extends ClassContent> C add(C item)
-
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
-
blankLine
public JClassDefSection blankLine()
Description copied from interface:JClassDefSectionAdd a blank line at this point of the type.- Specified by:
blankLinein interfaceJClassDefSection- Returns:
- this type 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
-
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
-
_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
-
lineComment
public JComment lineComment()
Description copied from interface:JCommentableAdd a line comment.- Specified by:
lineCommentin interfaceJCommentable- Returns:
- the line comment body
-
blockComment
public JComment blockComment()
Description copied from interface:JCommentableAdd a block comment.- Specified by:
blockCommentin interfaceJCommentable- Returns:
- the block comment body
-
write
public void write(SourceFileWriter writer) throws java.io.IOException
-
-