Package org.apache.sis.internal.doclet
Class Preformat
java.lang.Object
org.apache.sis.internal.doclet.Taglet
org.apache.sis.internal.doclet.Preformat
- All Implemented Interfaces:
jdk.javadoc.doclet.Taglet
The
@preformat
tag for inserting a pre-formatted code in a javadoc comment.
The first word after the tag must be the format name ("java", "math", "wkt", "xml", "sql",
"shell" or "text").
The remaining is the text to format.
This taglet will automatically replace &
, <
and >
by their HTML entities.
The only exception is @
, which is converted to the original @
character because
we cannot use that character directly inside this taglet.
- Since:
- 0.3
- Version:
- 1.0
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static enum
The set of legal words afterpreformat
.Nested classes/interfaces inherited from interface jdk.javadoc.doclet.Taglet
jdk.javadoc.doclet.Taglet.Location
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final String[]
Special characters to replace by HTML entities. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static void
colorJava
(String line, StringBuilder buffer) Adds syntactic coloration for the given line.protected void
format
(com.sun.source.doctree.DocTree tag, StringBuilder buffer) Given theDocTree
representation of this custom tag, appends its string representation.getName()
Returns the name of this custom tag.private static void
styleMath
(String line, StringBuilder buffer) Adds italic on variables in a math formulas.private static String
Removes the leading and trailing linefeeds (but not other kind of spaces).Methods inherited from class org.apache.sis.internal.doclet.Taglet
getAllowedLocations, getCurrentFile, init, isInlineTag, printError, printWarning, text, toString
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
isBlockTag
-
Field Details
-
SPECIAL_CHARS
Special characters to replace by HTML entities.
-
-
Constructor Details
-
Preformat
public Preformat()Constructs a@preformat
taglet.
-
-
Method Details
-
getName
Returns the name of this custom tag.- Returns:
- "preformat".
-
format
Given theDocTree
representation of this custom tag, appends its string representation. -
colorJava
Adds syntactic coloration for the given line. -
styleMath
Adds italic on variables in a math formulas. We will put in italic only the single latin letters. -
trim
Removes the leading and trailing linefeeds (but not other kind of spaces).
-