Class DefaultModelWriter

  • All Implemented Interfaces:
    ModelWriter

    public class DefaultModelWriter
    extends java.lang.Object
    implements ModelWriter
    • Constructor Detail

      • DefaultModelWriter

        public DefaultModelWriter()
    • 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 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
      • 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​(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 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
      • 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
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object