Class DefaultModelWriter

java.lang.Object
com.thoughtworks.qdox.writer.impl.DefaultModelWriter
All Implemented Interfaces:
ModelWriter

public class DefaultModelWriter extends Object implements ModelWriter
  • Field Details

  • Constructor Details

    • DefaultModelWriter

      public DefaultModelWriter()
  • Method Details

    • 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 interface ModelWriter
      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 interface ModelWriter
      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 interface ModelWriter
      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 interface ModelWriter
      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 interface ModelWriter
      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 interface ModelWriter
      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 interface ModelWriter
      Parameters:
      method - the method
      Returns:
      itself
    • writeNonAccessibilityModifiers

      private void writeNonAccessibilityModifiers(Collection<String> modifiers)
    • writeAccessibilityModifier

      private void writeAccessibilityModifier(Collection<String> modifiers)
    • writeAllModifiers

      private void writeAllModifiers(List<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 interface ModelWriter
      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 interface ModelWriter
      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 interface ModelWriter
      Parameters:
      descriptor - the module declaration
      Returns:
      itself
    • writeModuleExports

      public ModelWriter writeModuleExports(JavaModuleDescriptor.JavaExports exports)
      Write the module descriptors exports
      Specified by:
      writeModuleExports in interface ModelWriter
      Parameters:
      exports - the exports module statement
      Returns:
      itself
    • writeModuleOpens

      public ModelWriter writeModuleOpens(JavaModuleDescriptor.JavaOpens opens)
      Write the module descriptors opens
      Specified by:
      writeModuleOpens in interface ModelWriter
      Parameters:
      opens - the opens module statement
      Returns:
      itself
    • writeModuleProvides

      public ModelWriter writeModuleProvides(JavaModuleDescriptor.JavaProvides provides)
      Write the module descriptors provides
      Specified by:
      writeModuleProvides in interface ModelWriter
      Parameters:
      provides - the provides module statement
      Returns:
      itself
    • writeModuleRequires

      public ModelWriter writeModuleRequires(JavaModuleDescriptor.JavaRequires requires)
      Write the module descriptors requires
      Specified by:
      writeModuleRequires in interface ModelWriter
      Parameters:
      requires - the requires module statement
      Returns:
      itself
    • writeModuleUses

      public ModelWriter writeModuleUses(JavaModuleDescriptor.JavaUses uses)
      Write the module descriptors uses
      Specified by:
      writeModuleUses in interface ModelWriter
      Parameters:
      uses - the uses module statement
      Returns:
      itself
    • toString

      public String toString()
      Overrides:
      toString in class Object