|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.vmutil.options.Option
public abstract class Option
The abstract base class for all options. This class also has the static interfaces to access the options system to set option values.
All options within the system should have a unique name. No two options shall have a name that is the same when a case insensitive comparison between the names with spaces removed is performed. Only basic alphanumeric characters and spaces are allowed.
The VM is required to provide a one way mapping function that takes the name and creates a VM style name, such as mapping "No Finalizer" to noFinalizer. The VM may not remove any letters when performing this mapping but may remove spaces and change the case of any character.
Field Summary | |
---|---|
static int |
ADDRESS_OPTION
|
static int |
BOOLEAN_OPTION
|
private String |
description
|
static int |
ENUM_OPTION
|
static int |
FLOAT_OPTION
|
static int |
INT_OPTION
|
private String |
key
|
static int |
MICROSECONDS_OPTION
|
private String |
name
|
private Option |
next
|
static int |
PAGES_OPTION
|
static int |
RAW
|
static int |
READABLE
|
protected OptionSet |
set
|
static int |
STRING_OPTION
|
private int |
type
|
static int |
XML
|
Constructor Summary | |
---|---|
protected |
Option(OptionSet set,
int type,
String name,
String description)
Construct a new option. |
Method Summary | |
---|---|
protected void |
fail(String message)
A fatal error occurred during the setting of an option. |
protected void |
failIf(boolean condition,
String message)
Fail if a specified condition is met. |
String |
getDescription()
Return the option description. |
String |
getKey()
Return the VM determined key for an option |
String |
getName()
Return the name for the option. |
Option |
getNext()
Return the next option in the linked list. |
int |
getType()
Return the type of the option. |
(package private) void |
setNext(Option o)
Update the next pointer in the Option chain. |
protected void |
validate()
This is a validation method that can be implemented by leaf option classes to provide additional validation. |
protected void |
warn(String message)
A non-fatal error occurred during the setting of an option. |
protected void |
warnIf(boolean condition,
String message)
Warn if a specified condition is met. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int BOOLEAN_OPTION
public static final int STRING_OPTION
public static final int ENUM_OPTION
public static final int INT_OPTION
public static final int PAGES_OPTION
public static final int MICROSECONDS_OPTION
public static final int FLOAT_OPTION
public static final int ADDRESS_OPTION
public static final int READABLE
public static final int RAW
public static final int XML
private int type
private String name
private String description
private String key
private Option next
protected OptionSet set
Constructor Detail |
---|
protected Option(OptionSet set, int type, String name, String description)
set
- The option set this option belongs to.type
- The option type as defined in this class.name
- The unique name of the option.description
- A short description of the option and purpose.Method Detail |
---|
public String getKey()
void setNext(Option o)
public Option getNext()
public String getName()
public String getDescription()
public int getType()
protected void validate()
protected void fail(String message)
message
- The error message associated with the failure.protected void failIf(boolean condition, String message)
condition
- The condition that indicates failure.message
- The error message associated with the failure.protected void warn(String message)
message
- The message associated with the warning.protected void warnIf(boolean condition, String message)
condition
- The condition that indicates warning.message
- The message associated with the warning.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |