|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object pygmy.core.ConfigOption
public class ConfigOption
This class is used by handlers or endpoints to tell the server which options are used to configure the object.
Constructor Summary | |
---|---|
ConfigOption(java.lang.String propertyName,
boolean required,
java.lang.String helpString)
This is used to create a required property. |
|
ConfigOption(java.lang.String propertyName,
java.lang.String helpString)
This is used to create an optional property that defaults to null if unspecified. |
|
ConfigOption(java.lang.String propertyName,
java.lang.String defaultValue,
java.lang.String helpString)
This is used to create an optional property that has a supplied default value. |
Method Summary | |
---|---|
java.lang.Boolean |
getBoolean(Server server,
java.lang.String name)
This is used to fetch the value of the property as a Boolean. |
java.lang.Integer |
getInteger(Server server,
java.lang.String name)
This is used to fetch the value of the property as an Integer. |
java.lang.String |
getName()
The name of the configuration property that this ConfigOption was constructed with. |
java.lang.String |
getProperty(Server server,
java.lang.String name)
This is used to fetch the value of the property. |
java.lang.String |
toHelp()
This method is used to return a user viewable help string in case an object was misconfigured. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ConfigOption(java.lang.String propertyName, java.lang.String helpString)
propertyName
- the name of the property.helpString
- the help string shown to the user.public ConfigOption(java.lang.String propertyName, java.lang.String defaultValue, java.lang.String helpString)
propertyName
- the name of the property.defaultValue
- the default value used if this property is unspecified.helpString
- the help string shown to the user.public ConfigOption(java.lang.String propertyName, boolean required, java.lang.String helpString)
propertyName
- the name of the property.required
- Used to specify a required property. True for required, false for optional.helpString
- the help string shown to the user if nothing is specified.Method Detail |
---|
public java.lang.String getProperty(Server server, java.lang.String name)
server
- the Server object used by the system.name
- the name of the handler or endpoint instance.
public java.lang.Boolean getBoolean(Server server, java.lang.String name)
server
- the Server object used by the system.name
- the name of the handler or endpoint instance.
public java.lang.Integer getInteger(Server server, java.lang.String name)
server
- the Server object used by the system.name
- the name of the handler or endpoint instance.
public java.lang.String toHelp()
public java.lang.String getName()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |