Package org.apache.sis.internal.doclet
Class Taglet
java.lang.Object
org.apache.sis.internal.doclet.Taglet
- All Implemented Interfaces:
jdk.javadoc.doclet.Taglet
Base class of all taglets implemented in this package.
Taglets are assumed inline by default.
- Since:
- 0.3
- Version:
- 1.2
-
Nested Class Summary
Nested classes/interfaces inherited from interface jdk.javadoc.doclet.Taglet
jdk.javadoc.doclet.Taglet.Location
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate Element
The current element, ornull
if none.private jdk.javadoc.doclet.Reporter
Where to report warnings, ornull
if unknown.private com.sun.source.util.DocTrees
Utility methods for locating the path of elements, ornull
if unknown. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract void
format
(com.sun.source.doctree.DocTree tag, StringBuilder appendTo) Given a singleDocTree
s representing this custom tag, returns its string representation.Set<jdk.javadoc.doclet.Taglet.Location>
Returns the set of locations in which this taglet may be used.protected final Path
Returns the file that contains the current tag, ornull
if the method cannot determine the file.void
init
(jdk.javadoc.doclet.DocletEnvironment env, jdk.javadoc.doclet.Doclet doclet) Initializes this taglet with the given doclet environment and doclet.boolean
Returnstrue
by default since this base class is about inline tags.private void
print
(Diagnostic.Kind kind, String message) Prints an error or warning message.protected final void
printError
(String message) Prints an error message for the current tag.protected final void
printWarning
(String message) Prints a warning message for the current tag.(package private) static String
text
(com.sun.source.doctree.DocTree tag) Returns the text contained in the given inline tag.final String
Given a list ofDocTree
s representing this custom tag, returns its string representation.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface jdk.javadoc.doclet.Taglet
getName, isBlockTag
-
Field Details
-
reporter
private jdk.javadoc.doclet.Reporter reporterWhere to report warnings, ornull
if unknown. -
trees
private com.sun.source.util.DocTrees treesUtility methods for locating the path of elements, ornull
if unknown. -
element
The current element, ornull
if none.
-
-
Constructor Details
-
Taglet
Taglet()Constructs a default inline taglet.
-
-
Method Details
-
init
public void init(jdk.javadoc.doclet.DocletEnvironment env, jdk.javadoc.doclet.Doclet doclet) Initializes this taglet with the given doclet environment and doclet.- Specified by:
init
in interfacejdk.javadoc.doclet.Taglet
- Parameters:
env
- the environment in which the taglet is running.doclet
- the doclet that instantiated this taglet.
-
getAllowedLocations
Returns the set of locations in which this taglet may be used. By default the taglet can be used everywhere.- Specified by:
getAllowedLocations
in interfacejdk.javadoc.doclet.Taglet
- Returns:
- the set of locations in which this taglet may be used.
-
isInlineTag
public boolean isInlineTag()Returnstrue
by default since this base class is about inline tags.- Specified by:
isInlineTag
in interfacejdk.javadoc.doclet.Taglet
- Returns:
true
if this tagle is an inline taglet.
-
text
Returns the text contained in the given inline tag. -
getCurrentFile
Returns the file that contains the current tag, ornull
if the method cannot determine the file.- Returns:
- file containing the current tag, or
null
.
-
toString
Given a list ofDocTree
s representing this custom tag, returns its string representation. This method will be invoked once for each instance of the tag in parsed Javadoc.- Specified by:
toString
in interfacejdk.javadoc.doclet.Taglet
- Parameters:
tags
- the tags to format.element
- the element to which the enclosing comment belongs.- Returns:
- a string representation of the given tags.
-
format
Given a singleDocTree
s representing this custom tag, returns its string representation. This method will be invoked once for each instance of the tag in parsed Javadoc.- Parameters:
tag
- the tag to format.appendTo
- the buffer where to format the tag.
-
printWarning
Prints a warning message for the current tag.- Parameters:
message
- the warning message to print.
-
printError
Prints an error message for the current tag.- Parameters:
message
- the error message to print.
-
print
Prints an error or warning message.
-