public abstract class Javadoc extends java.lang.Object implements OptionHandler, RevisionHandler
| Modifier and Type | Field and Description |
|---|---|
protected java.lang.String |
m_Classname
the classname
|
protected java.lang.String |
m_Dir
the directory above the class to update
|
protected java.lang.String[] |
m_EndTag
the end tag
|
protected boolean |
m_Silent
whether to suppress error messages (no printout in the console)
|
protected java.lang.String[] |
m_StartTag
the start tag
|
protected boolean |
m_UseStars
whether to include the stars in the Javadoc
|
| Constructor and Description |
|---|
Javadoc() |
| Modifier and Type | Method and Description |
|---|---|
protected boolean |
canInstantiateClass()
returns true if the class can be instantiated, i.e., has a default
constructor.
|
java.lang.String |
generate()
generates either the plain Javadoc (if no filename specified) or the
updated file (if a filename is specified).
|
java.lang.String |
generateHelp()
generates a string to print as help on the console
|
protected java.lang.String |
generateJavadoc()
generates and returns the Javadoc
|
protected abstract java.lang.String |
generateJavadoc(int index)
generates and returns the Javadoc for the specified start/end tag pair.
|
java.lang.String |
getClassname()
returns the current classname
|
java.lang.String |
getDir()
returns the current dir containing the class to update.
|
protected int |
getIndentionLength(java.lang.String str)
determines the number of indention strings that have to be inserted to
generated the given indention string.
|
protected java.lang.String |
getIndentionString(java.lang.String str)
determines the base string of the given indention string, whether it's
either only spaces (one space will be retured) or mixed mode (tabs and
spaces, in that case the same string will be returned)
|
protected java.lang.Object |
getInstance()
Returns a new instance of the class
|
java.lang.String[] |
getOptions()
Gets the current settings of this object.
|
boolean |
getSilent()
whether output in the console is suppressed
|
boolean |
getUseStars()
whether the Javadoc is prefixed with "*"
|
protected java.lang.String |
indent(java.lang.String content,
int count,
java.lang.String indentStr)
indents the given string by a given number of indention strings
|
java.util.Enumeration<Option> |
listOptions()
Returns an enumeration describing the available options.
|
protected void |
println(java.lang.Object o)
prints the given object to System.err
|
protected static void |
runJavadoc(Javadoc javadoc,
java.lang.String[] options)
runs the javadoc producer with the given commandline options
|
void |
setClassname(java.lang.String value)
sets the classname of the class to generate the Javadoc for
|
void |
setDir(java.lang.String value)
sets the dir containing the file that is to be updated.
|
void |
setOptions(java.lang.String[] options)
Parses a given list of options.
|
void |
setSilent(boolean value)
sets whether to suppress output in the console
|
void |
setUseStars(boolean value)
sets whether to prefix the Javadoc with "*"
|
protected java.lang.String |
toHTML(java.lang.String s)
converts the given String into HTML, i.e., replacing some char entities
with HTML entities.
|
java.lang.String |
updateJavadoc()
generates the Javadoc and returns it applied to the source file if one was
provided, otherwise an empty string.
|
protected java.lang.String |
updateJavadoc(java.lang.String content)
updates the Javadoc in the given source code.
|
protected java.lang.String |
updateJavadoc(java.lang.String content,
int index)
generates and returns the Javadoc for the specified start/end tag pair
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetRevisionprotected java.lang.String[] m_StartTag
protected java.lang.String[] m_EndTag
protected java.lang.String m_Classname
protected boolean m_UseStars
protected java.lang.String m_Dir
protected boolean m_Silent
public java.util.Enumeration<Option> listOptions()
listOptions in interface OptionHandlerpublic void setOptions(java.lang.String[] options)
throws java.lang.Exception
setOptions in interface OptionHandleroptions - the list of options as an array of stringsjava.lang.Exception - if an option is not supportedpublic java.lang.String[] getOptions()
getOptions in interface OptionHandlerpublic void setClassname(java.lang.String value)
value - the new classnamepublic java.lang.String getClassname()
public void setUseStars(boolean value)
value - true if stars are usedpublic boolean getUseStars()
public void setDir(java.lang.String value)
value - the directory containing the classespublic java.lang.String getDir()
public void setSilent(boolean value)
value - true if output is to be suppressedpublic boolean getSilent()
protected void println(java.lang.Object o)
o - the object to printprotected boolean canInstantiateClass()
protected java.lang.Object getInstance()
protected java.lang.String toHTML(java.lang.String s)
s - the string to convertprotected java.lang.String indent(java.lang.String content,
int count,
java.lang.String indentStr)
content - the string to indentcount - the number of times to indent one lineindentStr - the indention stringprotected abstract java.lang.String generateJavadoc(int index)
throws java.lang.Exception
index - the index in the start/end tag arrayjava.lang.Exception - in case the generation failsprotected java.lang.String generateJavadoc()
throws java.lang.Exception
java.lang.Exception - in case the generation failsprotected java.lang.String getIndentionString(java.lang.String str)
str - the string to analyzeprotected int getIndentionLength(java.lang.String str)
str - the string to analyzeprotected java.lang.String updateJavadoc(java.lang.String content,
int index)
throws java.lang.Exception
content - the current source codeindex - the index in the start/end tag arrayjava.lang.Exception - in case the generation failsprotected java.lang.String updateJavadoc(java.lang.String content)
throws java.lang.Exception
content - the source codejava.lang.Exception - in case the generation failspublic java.lang.String updateJavadoc()
throws java.lang.Exception
java.lang.Exception - in case the generation failspublic java.lang.String generate()
throws java.lang.Exception
java.lang.Exception - in case the generation failspublic java.lang.String generateHelp()
protected static void runJavadoc(Javadoc javadoc, java.lang.String[] options)
javadoc - the javadoc producer to executeoptions - the commandline options