Enum JavadocTagInfo
- All Implemented Interfaces:
Serializable
,Comparable<JavadocTagInfo>
,Constable
This class was modeled after documentation located at javadoc and how to write.
Some of this documentation was a little incomplete (ex: valid placement of code, value, and literal tags).
Whenever an inconsistency was found the author's judgment was used.
For now, the number of required/optional tag arguments are not included
because some Javadoc tags have very complex rules for determining this
(ex: {@value}
tag).
Also, the isValidOn
method does not consider
classes defined in a local code block (method, init block, etc.).
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantsEnum ConstantDescription@author
.{@code}
.@deprecated
.{@docRoot}
.@exception
.{@inheritDoc}
.{@link}
.{@linkplain}
.{@literal}
.@param
.@return
.@see
.@serial
.@serialData
.@serialField
.@since
.@throws
.{@value}
.@version
. -
Method Summary
Modifier and TypeMethodDescriptionstatic JavadocTagInfo
Returns a JavadocTag from the tag name.static JavadocTagInfo
Returns a JavadocTag from the tag text.getName()
Gets the tag name.getText()
Gets the tag text.getType()
Gets the Tag type defined byType
.static boolean
isValidName
(String name) Returns whether the provided name is for a valid tag.abstract boolean
Checks if a particular Javadoc tag is valid within a Javadoc block of a given AST.toString()
static JavadocTagInfo
Returns the enum constant of this type with the specified name.static JavadocTagInfo[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
Enum Constant Details
-
AUTHOR
@author
. -
CODE
{@code}
. -
DOC_ROOT
{@docRoot}
. -
DEPRECATED
@deprecated
. -
EXCEPTION
@exception
. -
INHERIT_DOC
{@inheritDoc}
. -
LINK
{@link}
. -
LINKPLAIN
{@linkplain}
. -
LITERAL
{@literal}
. -
PARAM
@param
. -
RETURN
@return
. -
SEE
@see
. -
SERIAL
@serial
. -
SERIAL_DATA
@serialData
. -
SERIAL_FIELD
@serialField
. -
SINCE
@since
. -
THROWS
@throws
. -
VALUE
{@value}
. -
VERSION
@version
.
-
-
Method Details
-
values
Returns an array containing the constants of this enum type, in the order they are declared.- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is null
-
isValidOn
Checks if a particular Javadoc tag is valid within a Javadoc block of a given AST.If passing in a DetailAST representing a non-void METHOD_DEF
true
would be returned. If passing in a DetailAST representing a CLASS_DEFfalse
would be returned because CLASS_DEF's cannot return a value.- Parameters:
ast
- the AST representing a type that can be Javadoc'd- Returns:
- true if tag is valid.
-
getText
Gets the tag text.- Returns:
- the tag text
-
getName
Gets the tag name.- Returns:
- the tag name
-
getType
Gets the Tag type defined byType
.- Returns:
- the Tag type
-
fromText
Returns a JavadocTag from the tag text.- Parameters:
text
- String representing the tag text- Returns:
- Returns a JavadocTag type from a String representing the tag
- Throws:
NullPointerException
- if the text is nullIllegalArgumentException
- if the text is not a valid tag
-
fromName
Returns a JavadocTag from the tag name.- Parameters:
name
- String name of the tag- Returns:
- Returns a JavadocTag type from a String representing the tag
- Throws:
NullPointerException
- if the text is nullIllegalArgumentException
- if the text is not a valid tag. The name can be checked usingisValidName(String)
-
isValidName
Returns whether the provided name is for a valid tag.- Parameters:
name
- the tag name to check.- Returns:
- whether the provided name is for a valid tag.
-
toString
- Overrides:
toString
in classEnum<JavadocTagInfo>
-