public class TagletTextUtil extends Object
Extract and transform elements from the taglet text.
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/codelet| Modifier and Type | Method and Description |
|---|---|
static String |
getExampleClassFQName(CodeletInstance instance)
The example code's fully-qualified class name.
|
static String |
getExampleClassOrFilePortionFromTagletText(CodeletInstance instance)
The example-class or plain-text-file portion of the taglet text.
|
static String |
getExampleCommandLineParams(CodeletInstance instance)
The example code's command-line parameters, as used by
{@.codelet.out} and {@.codelet.and.out} taglets. |
static String |
getExamplePackageName(CodeletInstance instance)
Get the example code's package name.
|
static String |
getExampleSimpleClassName(CodeletInstance instance)
Get the example code's non-fully-qualified class name.
|
static String |
getFileNameWithExtension(CodeletInstance instance)
The plain-text file name, including its dot-extension (such as
".txt"), if any. |
static String |
getFileNameWithoutExtension(CodeletInstance instance)
The plain-text file name, excluding its dot-extension (such as
".txt"). |
static String |
getFilePath(CodeletInstance instance)
The full path to the plain-text file.
|
static String |
getJavaDocExampleUrl(CodeletInstance instance)
The absolute url to the example code's source file, as created by JavaDoc (in
{@docRoot}/src-html/). |
static String |
getJavaDocSourceUrl(CodeletInstance instance)
The absolute url to the example code's source file, as created by JavaDoc (in
{@docRoot}/src-html/). |
static String |
getJavaDocUrl(CodeletInstance instance) |
static String |
getJavaSourceFilePath(CodeletInstance instance)
The full on-disk path to the example code's source file.
|
static String[] |
getTagletTextSplitOnLineProcDelim(CodeletInstance instance)
The class-or-plain-text-file portion of the taglet text, split on the customizer delimiter character.
|
public static final String getExamplePackageName(CodeletInstance instance) throws CodeletFormatException
Get the example code's package name.
Class.forName(getExampleClassFQName(instance)).getPackage().getName()
CodeletFormatExceptionpublic static final String getExampleSimpleClassName(CodeletInstance instance) throws CodeletFormatException
Get the example code's non-fully-qualified class name.
Class.forName(getExampleClassFQName(instance)).getSimpleName()CodeletFormatExceptionpublic static final String getExampleClassFQName(CodeletInstance instance) throws CodeletFormatException
The example code's fully-qualified class name.
{@.codelet.out} or {@.codelet.and.out} taglet, and command-line parameters'('). Example:fully.qualified.examples.AnExample("param1", true, 3)fully.qualified.examples.AnExample{@.codelet} or {@.codelet.out} taglet: The entire class-portionCodeletFormatExceptiongetExampleCommandLineParams(CodeletInstance)public static final String getExampleCommandLineParams(CodeletInstance instance) throws CodeletFormatException
The example code's command-line parameters, as used by {@.codelet.out} and {@.codelet.and.out} taglets.
{@.codelet.out} or {@.codelet.and.out} taglet, and command-line parameters'(' and ')'). Example:fully.qualified.examples.AnExample("param1", true, 3)"param1", true, 3"".CodeletFormatExceptiongetExampleClassFQName(CodeletInstance)public static final String getFilePath(CodeletInstance instance)
The full path to the plain-text file.
public static final String getFileNameWithExtension(CodeletInstance instance)
The plain-text file name, including its dot-extension (such as ".txt"), if any.
public static final String getFileNameWithoutExtension(CodeletInstance instance)
The plain-text file name, excluding its dot-extension (such as ".txt").
public static final String getJavaSourceFilePath(CodeletInstance instance)
The full on-disk path to the example code's source file.
Example input
"fully.qualified.examples.AnExample""C:\java_code\"Output
"C:\java_code\fully\qualified\examples\AnExample.java"
CodeletBaseConfig.getExampleSourceBaseDir() +
getExampleClassFQName(instance).replace(".", FILE_SEP*) +
".java"public static final String getJavaDocSourceUrl(CodeletInstance instance)
The absolute url to the example code's source file, as created by JavaDoc (in {@docRoot}/src-html/).
Example input:
"fully.qualified.examples.AnExample"Output:
"{@docRoot}/src-html/fully/qualified/examples/AnExample.html"
Gap is filled with
getJavaDocSourceUrl([the-instance])
"../../../../src-html/" +
getExampleClassFQName(instance).replace(".", "/") +
".html"getJavaDocExampleUrl(CodeletInstance)public static final String getJavaDocUrl(CodeletInstance instance)
public static final String getJavaDocExampleUrl(CodeletInstance instance)
The absolute url to the example code's source file, as created by JavaDoc (in {@docRoot}/src-html/).
Example input:
"fully.qualified.examples.AnExample"Output:
"{@docRoot}/src-html/fully/qualified/examples/AnExample.html"
Gap is filled with
getJavaDocSourceUrl([the-instance])
"../../../.." +
getExampleClassFQName(instance).replace(".", "/") +
".html"getJavaDocSourceUrl(CodeletInstance)public static final String getExampleClassOrFilePortionFromTagletText(CodeletInstance instance) throws CodeletFormatException
The example-class or plain-text-file portion of the taglet text.
getTagletTextSplitOnLineProcDelim(instance)[0]CodeletFormatExceptionpublic static final String[] getTagletTextSplitOnLineProcDelim(CodeletInstance instance) throws CodeletFormatException
The class-or-plain-text-file portion of the taglet text, split on the customizer delimiter character.
instance - May not be nullCodeletFormatException - IfCodeletInstance.CodeletInstance#ESCAPED_CUSTOMIZER_PREFIX_CHAR ESCAPED_CUSTOMIZER_PREFIX_CHAR.CodeletInstance.getText(),
getExampleClassOrFilePortionFromTagletText(CodeletInstance),
CodeletInstance#CUSTOMIZER_PREFIX_CHARCopyright 2014, Jeff Epstein, All Rights Reserved. See top of source code files for copyright notice.
https://github.com/aliteralmind/codelet