java.lang.Object
com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocTag

public class JavadocTag extends Object
Represents a Javadoc tag. Provides methods to query what type of tag it is.
  • Field Details

    • lineNo

      private final int lineNo
      The line number of the tag.
    • columnNo

      private final int columnNo
      The column number of the tag.
    • firstArg

      private final String firstArg
      An optional first argument. For example the parameter name.
    • tagInfo

      private final JavadocTagInfo tagInfo
      The JavadocTagInfo representing this tag.
  • Constructor Details

    • JavadocTag

      public JavadocTag(int line, int column, String tag, String firstArg)
      Constructs the object.
      Parameters:
      line - the line number of the tag
      column - the column number of the tag
      tag - the tag string
      firstArg - the tag argument
    • JavadocTag

      public JavadocTag(int line, int column, String tag)
      Constructs the object.
      Parameters:
      line - the line number of the tag
      column - the column number of the tag
      tag - the tag string
  • Method Details

    • getTagName

      public String getTagName()
      Gets tag name.
      Returns:
      the tag string
    • getFirstArg

      public String getFirstArg()
      Returns first argument.
      Returns:
      the first argument. null if not set.
    • getLineNo

      public int getLineNo()
      Gets the line number.
      Returns:
      the line number
    • getColumnNo

      public int getColumnNo()
      Gets column number.
      Returns:
      the column number
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • isReturnTag

      public boolean isReturnTag()
      Checks that the tag is an 'return' tag.
      Returns:
      whether the tag is an 'return' tag
    • isParamTag

      public boolean isParamTag()
      Checks that the tag is an 'param' tag.
      Returns:
      whether the tag is an 'param' tag
    • isThrowsTag

      public boolean isThrowsTag()
      Checks that the tag is an 'throws' or 'exception' tag.
      Returns:
      whether the tag is an 'throws' or 'exception' tag
    • isSeeOrInheritDocTag

      public boolean isSeeOrInheritDocTag()
      Checks that the tag is a 'see' or 'inheritDoc' tag.
      Returns:
      whether the tag is a 'see' or 'inheritDoc' tag
    • isInheritDocTag

      public boolean isInheritDocTag()
      Checks that the tag is a 'inheritDoc' tag.
      Returns:
      whether the tag is a 'inheritDoc' tag
    • canReferenceImports

      public boolean canReferenceImports()
      Checks that the tag can contain references to imported classes.
      Returns:
      whether the tag can contain references to imported classes