com.tonbeller.wcf.format
Class NumberHandler
java.lang.Object
com.tonbeller.wcf.format.FormatHandlerSupport
com.tonbeller.wcf.format.NumberHandler
- All Implemented Interfaces:
- FormatHandler
- Direct Known Subclasses:
- DoubleHandler, IntegerHandler
- public abstract class NumberHandler
- extends FormatHandlerSupport
parses/prints numbers via DecimalFormat
Method Summary |
java.lang.String |
format(java.lang.Object o,
java.lang.String userPattern)
format an object |
double |
getMinValue()
Returns the minValue. |
java.lang.Object |
parse(java.lang.String s,
java.lang.String userPattern)
parse a String and create an object |
void |
setMinValue(double minValue)
Sets the minValue. |
Methods inherited from class com.tonbeller.wcf.format.FormatHandlerSupport |
addPattern, findPattern, getErrorMessage, getErrorMessage, getLocale, getName, getPattern, setErrorMessage, setLocale, setName, setPattern |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
NumberHandler
public NumberHandler()
format
public java.lang.String format(java.lang.Object o,
java.lang.String userPattern)
- Description copied from interface:
FormatHandler
- format an object
- Parameters:
o
- the object to formatuserPattern
- the format string to use. If null or empty string,
the configured pattern for the locale will be used.
parse
public java.lang.Object parse(java.lang.String s,
java.lang.String userPattern)
throws FormatException
- Description copied from interface:
FormatHandler
- parse a String and create an object
- Parameters:
s
- the string, eg user inputuserPattern
- the format string to use. If null or empty string,
the configured pattern for the locale will be used.
- Throws:
FormatException
getMinValue
public double getMinValue()
- Returns the minValue.
- Returns:
- double
setMinValue
public void setMinValue(double minValue)
- Sets the minValue.
- Parameters:
minValue
- The minValue to set