|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectde.kruis.padoclet.util.AbstractOption
public abstract class AbstractOption
Option handling for doclets. This class holds static methods and data about the options given to the doclet. Additionally instances of the class represent single options.
Field Summary | |
---|---|
java.lang.String |
defaultValue
the default value for the option. |
java.lang.String |
description
a description of the option. |
boolean |
isBoolean
true , if the option has no value parameter. |
boolean |
isTag
true , if the value of the option names a javadoc tag. |
static java.lang.String |
LF
Holds one line.separator character. |
static java.lang.String |
LI
Holds a line.separator and some spaces. |
java.lang.String |
name
the name of the option without the namePrefix. |
java.lang.String |
namePrefix
the common name namePrefix of this option |
static java.lang.String |
TAG_DELIMITER
Delimiters used to separate multiple alternative names for the same function. |
java.lang.String |
value
the value of the option. |
Constructor Summary | |
---|---|
AbstractOption(java.lang.String name,
java.lang.String namePrefix,
java.lang.String description)
Create a new option, that has no value (boolean option). |
|
AbstractOption(java.lang.String name,
java.lang.String namePrefix,
java.lang.String defaultValue,
boolean isTag,
java.lang.String description)
Create a new option, that has a value. |
Method Summary | |
---|---|
protected static AbstractOption |
get(java.lang.String name,
java.util.Map<java.lang.String,AbstractOption> options)
Get an option by name. |
protected static java.lang.String |
getDescriptions(java.util.Map<java.lang.String,AbstractOption> options)
Get a string made from the descriptions of all registered options. |
protected static java.util.Set<java.lang.String> |
getTags(java.util.Map<java.lang.String,AbstractOption> options)
Get all tags |
private static AbstractOption |
getWithPrefix(java.lang.String prefixedName,
java.util.Map<java.lang.String,AbstractOption> options)
Get an option by its prefixed name. |
protected static void |
initJavaBeanProperties(java.lang.Object bean,
java.util.Map<java.lang.String,AbstractOption> options)
Assign option values to matching bean properties. |
protected static void |
initOptions(java.lang.String[][] options,
java.util.Map<java.lang.String,AbstractOption> optionsMap)
Initialize the option values. |
boolean |
isSet()
Is a boolean option given? |
protected static int |
optionLength(java.lang.String name,
java.util.Map<java.lang.String,AbstractOption> options)
Get the number of parameters this option takes. |
protected static void |
register(AbstractOption option,
java.util.Map<java.lang.String,AbstractOption> options)
Register an option. |
java.lang.String |
toString()
|
Field Detail |
---|
public static final java.lang.String TAG_DELIMITER
public static final java.lang.String LF
public static final java.lang.String LI
public final java.lang.String name
public final java.lang.String namePrefix
public java.lang.String value
"true"
and "false"
are used.
public final java.lang.String defaultValue
"true"
and "false"
are used.
public final boolean isBoolean
true
, if the option has no value parameter. Otherwise, the
option takes one parameter.
public final boolean isTag
true
, if the value of the option names a javadoc tag.
This information is used to add -tag tagname:X
options to
the command line of the formating doclet.
public final java.lang.String description
Constructor Detail |
---|
public AbstractOption(java.lang.String name, java.lang.String namePrefix, java.lang.String defaultValue, boolean isTag, java.lang.String description)
name
- the namenamePrefix
- the common namePrefix of the option namedefaultValue
- the default valueisTag
- set to true
, if the value of the option names
a tag.description
- the description of the optionpublic AbstractOption(java.lang.String name, java.lang.String namePrefix, java.lang.String description)
name
- the namenamePrefix
- the common namePrefix of the option namedescription
- the description of the option.Method Detail |
---|
public boolean isSet()
true
, if a boolean option is set (to
be exact, if the value of the option is "true"
. Otherwise
returns false.public java.lang.String toString()
toString
in class java.lang.Object
protected static void register(AbstractOption option, java.util.Map<java.lang.String,AbstractOption> options)
option
- the option to register.options
- the options mapprotected static AbstractOption get(java.lang.String name, java.util.Map<java.lang.String,AbstractOption> options)
name
- the name of the option.options
- the options map
null
, if no option with the given
name was registered.protected static java.lang.String getDescriptions(java.util.Map<java.lang.String,AbstractOption> options)
options
- the options map
protected static java.util.Set<java.lang.String> getTags(java.util.Map<java.lang.String,AbstractOption> options)
options
- the options map
isTag
is set.private static AbstractOption getWithPrefix(java.lang.String prefixedName, java.util.Map<java.lang.String,AbstractOption> options)
prefixedName
- the name of the option including the namePrefix.options
- the options map
null
, if no matching option exists.protected static int optionLength(java.lang.String name, java.util.Map<java.lang.String,AbstractOption> options)
name
- the name of the option.options
- the options map
protected static void initOptions(java.lang.String[][] options, java.util.Map<java.lang.String,AbstractOption> optionsMap)
options
- the options as provided by the javadoc core.optionsMap
- the options mapDoclet.validOptions(java.lang.String[][], com.sun.javadoc.DocErrorReporter)
,
RootDoc.options()
protected static void initJavaBeanProperties(java.lang.Object bean, java.util.Map<java.lang.String,AbstractOption> options) throws java.lang.Throwable
String
, boolen
and
int
are supported.
bean
- a java beanoptions
- the options map
java.lang.Throwable
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |