Class DefaultModelWriter
- java.lang.Object
-
- com.thoughtworks.qdox.writer.impl.DefaultModelWriter
-
- All Implemented Interfaces:
ModelWriter
public class DefaultModelWriter extends java.lang.Object implements ModelWriter
-
-
Constructor Summary
Constructors Constructor Description DefaultModelWriter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidcommentHeader(JavaAnnotatedElement entity)protected IndentBuffergetBuffer()All information is written to this buffer.java.lang.StringtoString()ModelWriterwriteAnnotation(JavaAnnotation annotation)Write the java annotation A standard annotation writer should write: the annotation signatureModelWriterwriteClass(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 methodsModelWriterwriteConstructor(JavaConstructor constructor)Write the java constructor.ModelWriterwriteField(JavaField field)Write the java field A standard field writer should write: the javadoc the annotations the field signatureModelWriterwriteInitializer(JavaInitializer init)Write the initializer.ModelWriterwriteMethod(JavaMethod method)Write the java method A standard method writer should write: the javadoc the annotations the method signature, containing: the parametersModelWriterwriteModuleDescriptor(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 statementsModelWriterwriteModuleExports(JavaModuleDescriptor.JavaExports exports)Write the module descriptors exportsModelWriterwriteModuleOpens(JavaModuleDescriptor.JavaOpens opens)Write the module descriptors opensModelWriterwriteModuleProvides(JavaModuleDescriptor.JavaProvides provides)Write the module descriptors providesModelWriterwriteModuleRequires(JavaModuleDescriptor.JavaRequires requires)Write the module descriptors requiresModelWriterwriteModuleUses(JavaModuleDescriptor.JavaUses uses)Write the module descriptors usesModelWriterwritePackage(JavaPackage pckg)Write the java package A standard package writer should write: the javadoc the annotations the package signatureModelWriterwriteParameter(JavaParameter parameter)Write the java parameter A standard parameter writer should write: the javadoc the annotations the parameter signatureModelWriterwriteSource(JavaSource source)Write the complete source file A standard source writer should write: the package the imports the classes
-
-
-
Method Detail
-
getBuffer
protected final IndentBuffer getBuffer()
All information is written to this buffer. When extending this class you should write to this buffer- Returns:
- the buffer
-
writeSource
public ModelWriter writeSource(JavaSource source)
Write the complete source file A standard source writer should write:- the package
- the imports
- the classes
- Specified by:
writeSourcein interfaceModelWriter- Parameters:
source- the source- Returns:
- itself
-
writePackage
public ModelWriter writePackage(JavaPackage pckg)
Write the java package A standard package writer should write:- the javadoc
- the annotations
- the package signature
- Specified by:
writePackagein interfaceModelWriter- Parameters:
pckg- the package- Returns:
- itself
-
writeClass
public 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
- Specified by:
writeClassin interfaceModelWriter- Parameters:
cls- the class- Returns:
- itself
-
writeInitializer
public ModelWriter writeInitializer(JavaInitializer init)
Write the initializer.- Specified by:
writeInitializerin interfaceModelWriter- Parameters:
init- the initializer- Returns:
- itself
-
writeField
public ModelWriter writeField(JavaField field)
Write the java field A standard field writer should write:- the javadoc
- the annotations
- the field signature
- Specified by:
writeFieldin interfaceModelWriter- Parameters:
field- the field- Returns:
- itself
-
writeConstructor
public ModelWriter writeConstructor(JavaConstructor constructor)
Write the java constructor. A standard constructor writer should write:- the javadoc
- the annotations
- the constructor signature, containing:
- the parameters
- Specified by:
writeConstructorin interfaceModelWriter- Parameters:
constructor- the constructor- Returns:
- itself
-
writeMethod
public ModelWriter writeMethod(JavaMethod method)
Write the java method A standard method writer should write:- the javadoc
- the annotations
- the method signature, containing:
- the parameters
- Specified by:
writeMethodin interfaceModelWriter- Parameters:
method- the method- Returns:
- itself
-
writeAnnotation
public ModelWriter writeAnnotation(JavaAnnotation annotation)
Write the java annotation A standard annotation writer should write:- the annotation signature
- Specified by:
writeAnnotationin interfaceModelWriter- Parameters:
annotation- the annotation- Returns:
- itself
-
writeParameter
public ModelWriter writeParameter(JavaParameter parameter)
Write the java parameter A standard parameter writer should write:- the javadoc
- the annotations
- the parameter signature
- Specified by:
writeParameterin interfaceModelWriter- Parameters:
parameter- the parameter- Returns:
- itself
-
commentHeader
protected void commentHeader(JavaAnnotatedElement entity)
-
writeModuleDescriptor
public 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
- Specified by:
writeModuleDescriptorin interfaceModelWriter- Parameters:
descriptor- the module declaration- Returns:
- itself
-
writeModuleExports
public ModelWriter writeModuleExports(JavaModuleDescriptor.JavaExports exports)
Write the module descriptors exports- Specified by:
writeModuleExportsin interfaceModelWriter- Parameters:
exports- the exports module statement- Returns:
- itself
-
writeModuleOpens
public ModelWriter writeModuleOpens(JavaModuleDescriptor.JavaOpens opens)
Write the module descriptors opens- Specified by:
writeModuleOpensin interfaceModelWriter- Parameters:
opens- the opens module statement- Returns:
- itself
-
writeModuleProvides
public ModelWriter writeModuleProvides(JavaModuleDescriptor.JavaProvides provides)
Write the module descriptors provides- Specified by:
writeModuleProvidesin interfaceModelWriter- Parameters:
provides- the provides module statement- Returns:
- itself
-
writeModuleRequires
public ModelWriter writeModuleRequires(JavaModuleDescriptor.JavaRequires requires)
Write the module descriptors requires- Specified by:
writeModuleRequiresin interfaceModelWriter- Parameters:
requires- the requires module statement- Returns:
- itself
-
writeModuleUses
public ModelWriter writeModuleUses(JavaModuleDescriptor.JavaUses uses)
Write the module descriptors uses- Specified by:
writeModuleUsesin interfaceModelWriter- Parameters:
uses- the uses module statement- Returns:
- itself
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-