public class DefaultModelWriter extends Object implements ModelWriter
Constructor and Description |
---|
DefaultModelWriter() |
Modifier and Type | Method and Description |
---|---|
protected void |
commentHeader(JavaAnnotatedElement entity) |
protected IndentBuffer |
getBuffer()
All information is written to this buffer.
|
String |
toString() |
ModelWriter |
writeAnnotation(JavaAnnotation annotation)
Write the java annotation
A standard annotation writer should write:
the annotation signature
|
ModelWriter |
writeClass(JavaClass cls)
Write the java class
A standard class writer should write:
the javadoc
the annotations
the class signature, containing:
the fields
the constructors
the methods
|
ModelWriter |
writeConstructor(JavaConstructor constructor)
Write the java constructor.
|
ModelWriter |
writeField(JavaField field)
Write the java field
A standard field writer should write:
the javadoc
the annotations
the field signature
|
ModelWriter |
writeInitializer(JavaInitializer init)
Write the initializer.
|
ModelWriter |
writeMethod(JavaMethod method)
Write the java method
A standard method writer should write:
the javadoc
the annotations
the method signature, containing:
the parameters
|
ModelWriter |
writeModuleDescriptor(JavaModuleDescriptor descriptor)
Write the module descriptor
A standard module descriptor writer should write:
the javadoc
the annotations
the module signature, containing:
the requires statements
the exports statements
the opens statements
the uses statements
the provides statements
|
ModelWriter |
writeModuleExports(JavaModuleDescriptor.JavaExports exports)
Write the module descriptors exports
|
ModelWriter |
writeModuleOpens(JavaModuleDescriptor.JavaOpens opens)
Write the module descriptors opens
|
ModelWriter |
writeModuleProvides(JavaModuleDescriptor.JavaProvides provides)
Write the module descriptors provides
|
ModelWriter |
writeModuleRequires(JavaModuleDescriptor.JavaRequires requires)
Write the module descriptors requires
|
ModelWriter |
writeModuleUses(JavaModuleDescriptor.JavaUses uses)
Write the module descriptors uses
|
ModelWriter |
writePackage(JavaPackage pckg)
Write the java package
A standard package writer should write:
the javadoc
the annotations
the package signature
|
ModelWriter |
writeParameter(JavaParameter parameter)
Write the java parameter
A standard parameter writer should write:
the javadoc
the annotations
the parameter signature
|
ModelWriter |
writeSource(JavaSource source)
Write the complete source file
A standard source writer should write:
the package
the imports
the classes
|
protected final IndentBuffer getBuffer()
public ModelWriter writeSource(JavaSource source)
writeSource
in interface ModelWriter
source
- the sourcepublic ModelWriter writePackage(JavaPackage pckg)
writePackage
in interface ModelWriter
pckg
- the packagepublic ModelWriter writeClass(JavaClass cls)
writeClass
in interface ModelWriter
cls
- the classpublic ModelWriter writeInitializer(JavaInitializer init)
writeInitializer
in interface ModelWriter
init
- the initializerpublic ModelWriter writeField(JavaField field)
writeField
in interface ModelWriter
field
- the fieldpublic ModelWriter writeConstructor(JavaConstructor constructor)
writeConstructor
in interface ModelWriter
constructor
- the constructorpublic ModelWriter writeMethod(JavaMethod method)
writeMethod
in interface ModelWriter
method
- the methodpublic ModelWriter writeAnnotation(JavaAnnotation annotation)
writeAnnotation
in interface ModelWriter
annotation
- the annotationpublic ModelWriter writeParameter(JavaParameter parameter)
writeParameter
in interface ModelWriter
parameter
- the parameterprotected void commentHeader(JavaAnnotatedElement entity)
public ModelWriter writeModuleDescriptor(JavaModuleDescriptor descriptor)
writeModuleDescriptor
in interface ModelWriter
descriptor
- the module declarationpublic ModelWriter writeModuleExports(JavaModuleDescriptor.JavaExports exports)
writeModuleExports
in interface ModelWriter
exports
- the exports module statementpublic ModelWriter writeModuleOpens(JavaModuleDescriptor.JavaOpens opens)
writeModuleOpens
in interface ModelWriter
opens
- the opens module statementpublic ModelWriter writeModuleProvides(JavaModuleDescriptor.JavaProvides provides)
writeModuleProvides
in interface ModelWriter
provides
- the provides module statementpublic ModelWriter writeModuleRequires(JavaModuleDescriptor.JavaRequires requires)
writeModuleRequires
in interface ModelWriter
requires
- the requires module statementpublic ModelWriter writeModuleUses(JavaModuleDescriptor.JavaUses uses)
writeModuleUses
in interface ModelWriter
uses
- the uses module statementCopyright © 2002–2022. All rights reserved.