Class DefaultModelWriter
- java.lang.Object
-
- com.thoughtworks.qdox.writer.impl.DefaultModelWriter
-
- All Implemented Interfaces:
ModelWriter
public class DefaultModelWriter extends java.lang.Object implements ModelWriter
-
-
Field Summary
Fields Modifier and Type Field Description private IndentBuffer
buffer
-
Constructor Summary
Constructors Constructor Description DefaultModelWriter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
commentHeader(JavaAnnotatedElement entity)
protected IndentBuffer
getBuffer()
All information is written to this buffer.java.lang.String
toString()
private void
writeAccessibilityModifier(java.util.Collection<java.lang.String> modifiers)
private void
writeAllModifiers(java.util.List<java.lang.String> modifiers)
ModelWriter
writeAnnotation(JavaAnnotation annotation)
Write the java annotation A standard annotation writer should write: the annotation signatureModelWriter
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 methodsprivate ModelWriter
writeClassBody(JavaClass cls)
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 signatureModelWriter
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 parametersModelWriter
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 statementsModelWriter
writeModuleExports(JavaModuleDescriptor.JavaExports exports)
Write the module descriptors exportsModelWriter
writeModuleOpens(JavaModuleDescriptor.JavaOpens opens)
Write the module descriptors opensModelWriter
writeModuleProvides(JavaModuleDescriptor.JavaProvides provides)
Write the module descriptors providesModelWriter
writeModuleRequires(JavaModuleDescriptor.JavaRequires requires)
Write the module descriptors requiresModelWriter
writeModuleUses(JavaModuleDescriptor.JavaUses uses)
Write the module descriptors usesprivate void
writeNonAccessibilityModifiers(java.util.Collection<java.lang.String> modifiers)
ModelWriter
writePackage(JavaPackage pckg)
Write the java package A standard package writer should write: the javadoc the annotations the package signatureModelWriter
writeParameter(JavaParameter parameter)
Write the java parameter A standard parameter writer should write: the javadoc the annotations the parameter signatureModelWriter
writeSource(JavaSource source)
Write the complete source file A standard source writer should write: the package the imports the classes
-
-
-
Field Detail
-
buffer
private IndentBuffer buffer
-
-
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:
writeSource
in 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:
writePackage
in 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:
writeClass
in interfaceModelWriter
- Parameters:
cls
- the class- Returns:
- itself
-
writeClassBody
private ModelWriter writeClassBody(JavaClass cls)
-
writeInitializer
public ModelWriter writeInitializer(JavaInitializer init)
Write the initializer.- Specified by:
writeInitializer
in 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:
writeField
in 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:
writeConstructor
in 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:
writeMethod
in interfaceModelWriter
- Parameters:
method
- the method- Returns:
- itself
-
writeNonAccessibilityModifiers
private void writeNonAccessibilityModifiers(java.util.Collection<java.lang.String> modifiers)
-
writeAccessibilityModifier
private void writeAccessibilityModifier(java.util.Collection<java.lang.String> modifiers)
-
writeAllModifiers
private void writeAllModifiers(java.util.List<java.lang.String> modifiers)
-
writeAnnotation
public ModelWriter writeAnnotation(JavaAnnotation annotation)
Write the java annotation A standard annotation writer should write:- the annotation signature
- Specified by:
writeAnnotation
in 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:
writeParameter
in 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:
writeModuleDescriptor
in interfaceModelWriter
- Parameters:
descriptor
- the module declaration- Returns:
- itself
-
writeModuleExports
public ModelWriter writeModuleExports(JavaModuleDescriptor.JavaExports exports)
Write the module descriptors exports- Specified by:
writeModuleExports
in interfaceModelWriter
- Parameters:
exports
- the exports module statement- Returns:
- itself
-
writeModuleOpens
public ModelWriter writeModuleOpens(JavaModuleDescriptor.JavaOpens opens)
Write the module descriptors opens- Specified by:
writeModuleOpens
in interfaceModelWriter
- Parameters:
opens
- the opens module statement- Returns:
- itself
-
writeModuleProvides
public ModelWriter writeModuleProvides(JavaModuleDescriptor.JavaProvides provides)
Write the module descriptors provides- Specified by:
writeModuleProvides
in interfaceModelWriter
- Parameters:
provides
- the provides module statement- Returns:
- itself
-
writeModuleRequires
public ModelWriter writeModuleRequires(JavaModuleDescriptor.JavaRequires requires)
Write the module descriptors requires- Specified by:
writeModuleRequires
in interfaceModelWriter
- Parameters:
requires
- the requires module statement- Returns:
- itself
-
writeModuleUses
public ModelWriter writeModuleUses(JavaModuleDescriptor.JavaUses uses)
Write the module descriptors uses- Specified by:
writeModuleUses
in interfaceModelWriter
- Parameters:
uses
- the uses module statement- Returns:
- itself
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-