Package net.sf.jguiraffe.transform
Class LongTransformer
- java.lang.Object
-
- net.sf.jguiraffe.transform.NumberTransformerBase<T>
-
- net.sf.jguiraffe.transform.AbstractIntegerTransformer<Long>
-
- net.sf.jguiraffe.transform.LongTransformer
-
- All Implemented Interfaces:
Transformer
,Validator
public class LongTransformer extends AbstractIntegerTransformer<Long>
A specialized number transformer implementation that deals with numbers of type
java.lang.Long
.This class implements the abstract methods defined by its super classes in a way suitable for
java.lang.Long
objects. It does not define any new properties or error messages. Refer to the documentation of
for a list of all supported properties and possible error messages.NumberTransformerBase
- Version:
- $Id: LongTransformer.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 LongTransformer()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected Long
convert(Number n)
Converts the given number into aLong
.protected Long
fetchProperty(org.apache.commons.configuration.Configuration config, String property, Long defaultValue)
Fetches a long property from the specified configuration.-
Methods inherited from class net.sf.jguiraffe.transform.AbstractIntegerTransformer
createFormat
-
Methods inherited from class net.sf.jguiraffe.transform.NumberTransformerBase
errorResult, getMaximum, getMinimum, isNumberValid, isValid, setMaximum, setMinimum, transform, transformToNumber
-
-
-
-
Method Detail
-
convert
protected Long convert(Number n)
Converts the given number into aLong
. This implementation also checks whether the number fits into the value range ofLong
and throws anIllegalArgumentException
if not.- Specified by:
convert
in classNumberTransformerBase<Long>
- Parameters:
n
- the number to convert- Returns:
- the converted number
- Throws:
IllegalArgumentException
- if the number cannot be converted to aLong
-
fetchProperty
protected Long fetchProperty(org.apache.commons.configuration.Configuration config, String property, Long defaultValue)
Fetches a long property from the specified configuration.- Specified by:
fetchProperty
in classNumberTransformerBase<Long>
- Parameters:
config
- the configurationproperty
- the propertydefaultValue
- the default value- Returns:
- the value of this property
-
-