com.martiansoftware.jsap
Class PropertyStringParser
java.lang.Object
com.martiansoftware.jsap.StringParser
com.martiansoftware.jsap.PropertyStringParser
- Direct Known Subclasses:
- DateStringParser, FileStringParser
- public abstract class PropertyStringParser
- extends StringParser
A StringParser
subclass that provides a means for setting/getting properties.
This
is intended to support StringParsers that might requires some configuration,
such
as DateStringParser (which needs a format String).
- Author:
- Marty Lamb
- See Also:
StringParser
,
DateStringParser
Method Summary |
String |
getProperty(String key)
Returns the property associated with the specified key, or null if no
such
property exists. |
String |
getProperty(String key,
String defaultValue)
Returns the property associated with the specified key, or the specified
default value if no such property exists. |
void |
setProperty(String key,
String value)
Sets the property with the specified key to the specified value. |
PropertyStringParser
public PropertyStringParser()
setProperty
public void setProperty(String key,
String value)
- Sets the property with the specified key to the specified value.
- Parameters:
key
- the key of the property to set.value
- the value to associated with the specified key.- See Also:
Properties.setProperty(String,String)
getProperty
public String getProperty(String key)
- Returns the property associated with the specified key, or null if no
such
property exists.
- Parameters:
key
- the key of the desired property
- Returns:
- the property associated with the specified key, or null if no
such
property exists.
getProperty
public String getProperty(String key,
String defaultValue)
- Returns the property associated with the specified key, or the specified
default value if no such property exists.
- Parameters:
key
- the key of the desired propertydefaultValue
- the default value to return if no such property exists
- Returns:
- the requested property, or the specified default value if no such property exists.
Copyright © 2002-2006, Martian Software, Inc.. All Rights Reserved.
For the latest version and documentation, please visit http://www.martiansoftware.com/jsap