Class AbstractJComment

    • Constructor Detail

      • AbstractJComment

        AbstractJComment()
    • Method Detail

      • addItemDirectly

        void addItemDirectly​(Writable item)
      • text

        public JComment text​(java.lang.String text)
        Description copied from interface: JComment
        Add some text to the end of this comment. No formatting or line breaks are inserted.
        Specified by:
        text in interface JComment
        Parameters:
        text - the text to add
        Returns:
        this comment
      • sp

        public JComment sp()
        Description copied from interface: JComment
        Add a non-trailing space. If no content follows, the space will be omitted.
        Specified by:
        sp in interface JComment
        Returns:
        this comment
      • typeName

        public JComment typeName​(JType type)
        Description copied from interface: JComment
        Add a type name to the end of this comment. If the type is imported, it will emit as a simple name, otherwise it will emit as a qualified name.
        Specified by:
        typeName in interface JComment
        Parameters:
        type - the type name to add
        Returns:
        this comment
      • block

        public JComment block()
        Description copied from interface: JComment
        Add a comment sub-block at this location. The block has no visual representation but allows text to be inserted at the point of the block even after more content was appended after it.
        Specified by:
        block in interface JComment
        Returns:
        the comment sub-block
      • inlineDocTag

        public JComment inlineDocTag​(java.lang.String tag,
                                     java.lang.String body)
        Description copied from interface: JComment
        Add an inline doc tag with simple content.
        Specified by:
        inlineDocTag in interface JComment
        Parameters:
        tag - the tag name (without the leading @ sign)
        body - the complete tag body
        Returns:
        this comment
      • inlineDocTag

        public JComment inlineDocTag​(java.lang.String tag)
        Description copied from interface: JComment
        Add an inline doc tag.
        Specified by:
        inlineDocTag in interface JComment
        Parameters:
        tag - the tag name (without the leading @ sign)
        Returns:
        the body of the doc tag
      • linkType

        public JComment linkType​(boolean plain,
                                 JType targetType)
        Description copied from interface: JComment
        Add an inline @link to a type.
        Specified by:
        linkType in interface JComment
        Parameters:
        plain - true to render in plain font, false to render in monospace font
        targetType - the target type to link to
        Returns:
        the body of the link tag
      • linkField

        public JComment linkField​(boolean plain,
                                  JType targetType,
                                  java.lang.String targetField)
        Description copied from interface: JComment
        Add an inline @link to a field of a type.
        Specified by:
        linkField in interface JComment
        Parameters:
        plain - true to render in plain font, false to render in monospace font
        targetType - the target type to link to
        targetField - the target field to link to
        Returns:
        the body of the link tag
      • linkConstructor

        public JComment linkConstructor​(boolean plain,
                                        JType targetType,
                                        JType... params)
        Description copied from interface: JComment
        Add an inline @link to a constructor.
        Specified by:
        linkConstructor in interface JComment
        Parameters:
        plain - true to render in plain font, false to render in monospace font
        targetType - the target type to link to
        params - the argument types of the constructor to link to
        Returns:
        the body of the link tag
      • linkMethod

        public JComment linkMethod​(boolean plain,
                                   JType targetType,
                                   java.lang.String targetMethod,
                                   JType... params)
        Description copied from interface: JComment
        Add an inline @link to a method.
        Specified by:
        linkMethod in interface JComment
        Parameters:
        plain - true to render in plain font, false to render in monospace font
        targetType - the target type to link to
        targetMethod - the name of the method to link to
        params - the argument types of the method to link to
        Returns:
        the body of the link tag
      • linkMethod

        public JComment linkMethod​(boolean plain,
                                   JMethodDef methodDef)
        Description copied from interface: JComment
        Add an inline @link to a method.
        Specified by:
        linkMethod in interface JComment
        Parameters:
        plain - true to render in plain font, false to render in monospace font
        methodDef - the method to link to
        Returns:
        the body of the link tag
      • code

        public JComment code()
        Description copied from interface: JComment
        Add an inline code tag.
        Specified by:
        code in interface JComment
        Returns:
        the code tag content
      • docRoot

        public JComment docRoot()
        Description copied from interface: JComment
        Add the {@docRoot} tag at this position.
        Specified by:
        docRoot in interface JComment
        Returns:
        this comment
      • nl

        public JComment nl()
        Description copied from interface: JComment
        Add a newline.
        Specified by:
        nl in interface JComment
        Returns:
        this comment
      • write

        public void write​(SourceFileWriter writer)
                   throws java.io.IOException
        Specified by:
        write in interface Writable
        Throws:
        java.io.IOException
      • getContent

        java.util.List<Writable> getContent()