class JClassDefSectionImpl extends java.lang.Object implements JClassDefSection, ClassContent
| Modifier and Type | Field and Description |
|---|---|
private java.util.ArrayList<ClassContent> |
content |
private Sectionable |
sectionable |
| Constructor and Description |
|---|
JClassDefSectionImpl(Sectionable sectionable) |
| 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.
|
JClassDef |
_interface(int mods,
java.lang.String name)
Add a nested interface to this type.
|
(package private) <C extends ClassContent> |
add(C item) |
JClassDef |
annotationInterface(int mods,
java.lang.String name)
Add a nested annotation interface to this type.
|
JClassDefSection |
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.
|
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.
|
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.
|
void |
write(SourceFileWriter writer) |
private final Sectionable sectionable
private final java.util.ArrayList<ClassContent> content
JClassDefSectionImpl(Sectionable sectionable)
<C extends ClassContent> C add(C item)
public JClassDefSection section()
JClassDefSectionsection in interface JClassDefSectionpublic JClassDefSection blankLine()
JClassDefSectionblankLine in interface JClassDefSectionpublic JBlock init()
JClassDefSectioninit in interface JClassDefSectionpublic JBlock staticInit()
JClassDefSectionstaticInit in interface JClassDefSectionpublic 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 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 namepublic JComment lineComment()
JCommentablelineComment in interface JCommentablepublic JComment blockComment()
JCommentableblockComment in interface JCommentablepublic void write(SourceFileWriter writer) throws java.io.IOException