Class AbstractJComment

java.lang.Object
org.jboss.jdeparser.AbstractJComment
All Implemented Interfaces:
JComment, Writable
Direct Known Subclasses:
AbstractJHtmlComment, BlockJComment, InlineDocTagCommentContent, LineJComment, NestedCommentContent

abstract class AbstractJComment extends Object implements JComment, Writable
  • Field Details

  • Constructor Details

    • AbstractJComment

      AbstractJComment()
  • Method Details

    • addItemDirectly

      void addItemDirectly(Writable item)
    • add

      protected <T extends CommentContent> T add(T item)
    • text

      public JComment text(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(String tag, 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(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, 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, 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 {&#64;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 IOException
      Specified by:
      write in interface Writable
      Throws:
      IOException
    • getContent

      List<Writable> getContent()