Class PropertyStringParser
java.lang.Object
com.martiansoftware.jsap.StringParser
com.martiansoftware.jsap.PropertyStringParser
- Direct Known Subclasses:
DateStringParser, FileStringParser
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:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetProperty(String key) Returns the property associated with the specified key, or null if no such property exists.getProperty(String key, String defaultValue) Returns the property associated with the specified key, or the specified default value if no such property exists.voidsetProperty(String key, String value) Sets the property with the specified key to the specified value.Methods inherited from class StringParser
parse, setUp, tearDown
-
Constructor Details
-
PropertyStringParser
public PropertyStringParser()
-
-
Method Details
-
setProperty
-
getProperty
-
getProperty
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.
-