public class CodeletInstance extends Object
Represents a single codelet-taglet, as found by javadoc.exe. Contains its basic elements that compose a single codelet: Its name, text, and enclosing class. Also contains the relative url to the JavaDoc root directory ("{@docRoot}"), and utility functions.
aliteralmind __DASH__ github __AT__ yahoo __DOT__ com), dual-licensed under the LGPL (version 3.0 or later) or the ASL (version 2.0). See source code for details. http://codelet.aliteralmind.com, https://github.com/aliteralmind/codelettaglet.CodletComSunJavadocTagProcessor#get(Tag)| Modifier and Type | Field and Description |
|---|---|
static char |
CUSTOMIZER_PREFIX_CHAR
The character that divides the fully-qualified class-name or plain-text file-path, and its optional Codelet-customizer--Equal to
'%'. |
static String |
DEBUG_LEVEL_PREFIX_PREFIX
The prefix that, if found before a taglet's text, turns on debugging for that taglet only--Equal to
"[DEBUG_LEVEL_". |
static String |
ESCAPED_CUSTOMIZER_PREFIX_CHAR
When the customizer prefix-char needs to be literally displayed in a string-value parameter--Equal to
"%". |
| Constructor and Description |
|---|
CodeletInstance(String taglet_name,
String enclosing_package,
String enclosing_simpleName,
File enclosing_file,
int line_num,
String tag_text,
String relUrl_toDocRoot)
Create a new Codelet from its taglet elements.
|
| Modifier and Type | Method and Description |
|---|---|
DebugLevel |
getDebugLevel()
The debugging level for this taglet only, as defined in the optional override prefix.
|
Class<?> |
getEnclosingClass()
Get the taglet's enclosing class object, if it is a class.
|
File |
getEnclosingFile()
The file-object whose source code contains a JavaDoc block, in which this codelet exists.
|
String |
getEnclosingFullyQualifiedName()
Get the fully-qualified name of the taglet's enclosing JavaDoc file.
|
String |
getEnclosingPackage()
The package name of this taglet's containing JavaDoc file.
|
String |
getEnclosingSimpleName()
The post-package name of this taglet's containing JavaDoc file.
|
String |
getFullOriginalTaglet()
Returns the full original taglet, exactly as found in the JavaDoc.
|
int |
getLineNumber()
The line number in the enclosing classes source-code, at which this codelet exists.
|
String |
getRelativeUrlToDocRoot()
The relative directory from the containing classes JavaDoc file, to the JavaDoc root directory--Equivalent to
{@docRoot}. |
String |
getText()
The original, unaltered text, as found after the taglet's name (and any whitespace).
|
CodeletType |
getType()
The type of this Codelet, which implies its name.
|
boolean |
isOverviewSummary()
Is the enclosing file the overview summary page?.
|
String |
toString()
The enclosing file, plus line number, followed by the full taglet text.
|
public static final String DEBUG_LEVEL_PREFIX_PREFIX
The prefix that, if found before a taglet's text, turns on debugging for that taglet only--Equal to "[DEBUG_LEVEL_". This overrides global debugging, but only if the taglet level is higher.
Example:
[DEBUG_LEVEL_3]{@.codelet com.github.myjavacode.examples.AnExample}
If global debugging is , then this taglet outputs all 1, 2, and 3-level debugging statements.OFF
public static final char CUSTOMIZER_PREFIX_CHAR
The character that divides the fully-qualified class-name or plain-text file-path, and its optional Codelet-customizer--Equal to '%'.
If there is no customizer, this character must not exist in the taglet's text. For literally-displaying this character (in a string-value parameter, for either the processor or the example code's main function), use ESCAPED_CUSTOMIZER_PREFIX_CHAR.
This cannot be a colon, because it conflicts with absolute Windows paths (such as C:\java_code\).
public static final String ESCAPED_CUSTOMIZER_PREFIX_CHAR
When the customizer prefix-char needs to be literally displayed in a string-value parameter--Equal to "&#37;".
public CodeletInstance(String taglet_name, String enclosing_package, String enclosing_simpleName, File enclosing_file, int line_num, String tag_text, String relUrl_toDocRoot)
Create a new Codelet from its taglet elements.
taglet_name - The name of the taglet, which implies its type. Get with getType().enclosing_package - The fully-qualified class name of the codelet's enclosing class--the class whose source-code contains a JavaDoc block, in which this taglet exists. This must be an actually-existing class, as determined by
Class.forName(enclosing_package). Get with getEnclosingPackage().enclosing_simpleName - The name of the enclosing file, without any path (or generics or function signature). If the containing file is the overview summary, this must equal "OVERVIEW_SUMMARY". If a package summary, this must be "PACKAGE_SUMMARY".enclosing_file - The enclosing file's File object, which contains the full path to its source code.line_num - The line number in the enclosing classes source code, at which this taglet exists. May not be less than one. Get with getLineNumber().tag_text - The original text following the taglet's name. For example, if the taglet is
{@.codelet.out my.package.examples.AnExample((byte)-30, true, "Ribsy")%()}
my.package.examples.AnExample((byte)-30, true, "Ribsy"):()
getText(). Any literal curly braces ('{' or ''}') found in string parameters are replaced with actual braces: '{' and '}'. Escaping curlys is required in order to prevent javadoc.exe from incorrectly parsing taglets.relUrl_toDocRoot - The relative directory from the containing JavaDoc file to the JavaDoc root directory (the value of {@docRoot}). Get with getRelativeUrlToDocRoot().public String getText()
The original, unaltered text, as found after the taglet's name (and any whitespace).
CodeletInstance(s,s,s,f,i,s,s)public CodeletType getType()
The type of this Codelet, which implies its name.
Tag.name(),
CodeletInstance(s,s,s,f,i,s,s)public Class<?> getEnclosingClass()
Get the taglet's enclosing class object, if it is a class.
Class.forName(getEnclosingFullyQualifiedName())
getClassIfExistsOrNull(getEnclosingFullyQualifiedName())
null.public String getEnclosingFullyQualifiedName()
Get the fully-qualified name of the taglet's enclosing JavaDoc file. If it is a class, this is appropriate for .Class.forName)
getEnclosingPackage() hasgetEnclosingPackage() + getEnclosingSimpleName()getEnclosingPackage() + "." + getEnclosingSimpleName()getEnclosingClass()public String getEnclosingPackage()
The package name of this taglet's containing JavaDoc file.
public boolean isOverviewSummary()
Is the enclosing file the overview summary page?.
(getEnclosingPackage().length() == 0)public String getEnclosingSimpleName()
The post-package name of this taglet's containing JavaDoc file.
getEnclosingPackage()public File getEnclosingFile()
The file-object whose source code contains a JavaDoc block, in which this codelet exists. This contains the full path to the enclosing classes source code.
public int getLineNumber()
The line number in the enclosing classes source-code, at which this codelet exists.
CodeletInstance(s,s,s,f,i,s,s)public String getRelativeUrlToDocRoot()
The relative directory from the containing classes JavaDoc file, to the JavaDoc root directory--Equivalent to {@docRoot}.
CodeletInstance(s,s,s,f,i,s,s)public DebugLevel getDebugLevel()
The debugging level for this taglet only, as defined in the optional override prefix. This is used only when it is at a higher level than global debugging.
public String toString()
The enclosing file, plus line number, followed by the full taglet text.
toString in class ObjectgetEnclosingFile() + "(" + getLineNumber() "): " + getFullOriginalTaglet()public String getFullOriginalTaglet()
Returns the full original taglet, exactly as found in the JavaDoc.
"{@" + [the-debug-prefix-if-provided] + getType().getName() + " " + getText() + "}"Copyright 2014, Jeff Epstein, All Rights Reserved. See top of source code files for copyright notice.
https://github.com/aliteralmind/codelet