Class DefaultJavaDocRenderer

  • All Implemented Interfaces:
    JavaDocRenderer
    Direct Known Subclasses:
    NoAuthorJavaDocRenderer

    public class DefaultJavaDocRenderer
    extends java.lang.Object
    implements JavaDocRenderer

    Default JavaDocRenderer implementation which provides a plain JavaDocData rendering, on the form:

         [JavaDoc comment]
         (tag1): [tag1 value]
         (tag2): [tag2 value]
     
    Since:
    2.0
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected java.lang.String harmonizeNewlines​(java.lang.String original)
      Squashes newline characters into
      java.lang.String render​(JavaDocData nonNullData, SortableLocation location)
      Renders the supplied JavaDocData structure as text to be used within an XSD documentation annotation.
      protected java.lang.String renderJavaDocComment​(java.lang.String comment, SortableLocation location)
      Override this method to yield another rendering of the javadoc comment.
      protected java.lang.String renderJavaDocTag​(java.lang.String name, java.lang.String value, SortableLocation location)
      Override this method to yield another
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • DefaultJavaDocRenderer

        public DefaultJavaDocRenderer()
    • Method Detail

      • render

        public java.lang.String render​(JavaDocData nonNullData,
                                       SortableLocation location)

        Renders the supplied JavaDocData structure as text to be used within an XSD documentation annotation. The XSD documentation annotation will contain a CDATA section to which the rendered JavaDocData is emitted.

        Specified by:
        render in interface JavaDocRenderer
        Parameters:
        nonNullData - the JavaDocData instance to render as XSD documentation. Will never be null.
        location - the SortableLocation where the JavaDocData was harvested. Never null.
        Returns:
        The rendered text contained within the XML annotation.
      • renderJavaDocComment

        protected java.lang.String renderJavaDocComment​(java.lang.String comment,
                                                        SortableLocation location)
        Override this method to yield another rendering of the javadoc comment.
        Parameters:
        comment - The comment to render.
        location - the SortableLocation where the JavaDocData was harvested. Never null.
        Returns:
        The XSD documentation for the supplied JavaDoc comment. A null or empty value will not be rendered.
      • renderJavaDocTag

        protected java.lang.String renderJavaDocTag​(java.lang.String name,
                                                    java.lang.String value,
                                                    SortableLocation location)
        Override this method to yield another
        Parameters:
        name - The name of a JavaDoc tag.
        value - The value of a JavaDoc tag.
        location - the SortableLocation where the JavaDocData was harvested. Never null.
        Returns:
        The XSD documentation for the supplied JavaDoc tag.
      • harmonizeNewlines

        protected java.lang.String harmonizeNewlines​(java.lang.String original)
        Squashes newline characters into
        Parameters:
        original - the original string, potentially containing newline characters.
        Returns:
        A string where all newline characters are removed