Package net.sf.jguiraffe.transform
Class DoubleTransformer
- java.lang.Object
-
- net.sf.jguiraffe.transform.NumberTransformerBase<T>
-
- net.sf.jguiraffe.transform.AbstractDecimalTransformer<Double>
-
- net.sf.jguiraffe.transform.DoubleTransformer
-
- All Implemented Interfaces:
Transformer,Validator
public final class DoubleTransformer extends AbstractDecimalTransformer<Double>
A specialized number transformer implementation that deals with numbers of type
java.lang.Double.This class implements the abstract methods defined by its super classes in a way suitable for
java.lang.Doubleobjects. It does not define any new properties or error messages. Refer to the documentation offor a list of all supported properties and possible error messages.NumberTransformerBase- Version:
- $Id: DoubleTransformer.java 205 2012-01-29 18:29:57Z oheger $
- Author:
- Oliver Heger
-
-
Field Summary
-
Fields inherited from class net.sf.jguiraffe.transform.NumberTransformerBase
PROP_MAXIMUM, PROP_MINIMUM
-
-
Constructor Summary
Constructors Constructor Description DoubleTransformer()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected Doubleconvert(Number n)Converts the specified number into ajava.lang.Double.protected DoublefetchProperty(org.apache.commons.configuration.Configuration config, String property, Double defaultValue)Returns a configuration property of typeDouble.-
Methods inherited from class net.sf.jguiraffe.transform.AbstractDecimalTransformer
createFormat
-
Methods inherited from class net.sf.jguiraffe.transform.NumberTransformerBase
errorResult, getMaximum, getMinimum, isNumberValid, isValid, setMaximum, setMinimum, transform, transformToNumber
-
-
-
-
Method Detail
-
convert
protected Double convert(Number n)
Converts the specified number into ajava.lang.Double. A range check will be performed.- Specified by:
convertin classNumberTransformerBase<Double>- Parameters:
n- the number to be converted- Returns:
- the converted number
- Throws:
IllegalArgumentException- if the number cannot be converted into aDouble
-
fetchProperty
protected Double fetchProperty(org.apache.commons.configuration.Configuration config, String property, Double defaultValue)
Returns a configuration property of typeDouble.- Specified by:
fetchPropertyin classNumberTransformerBase<Double>- Parameters:
config- the configurationproperty- the propertydefaultValue- the default value- Returns:
- the value of the property
-
-