org.pm4j.core.pm.impl.converter
Class PmConverterNumber<T extends java.lang.Number>

java.lang.Object
  extended by org.pm4j.core.pm.impl.converter.PmConverterSerializeableBase<T>
      extended by org.pm4j.core.pm.impl.converter.PmConverterNumber<T>
Type Parameters:
T - The concrete Number type to convert.
All Implemented Interfaces:
PmAttr.Converter<T>
Direct Known Subclasses:
PmConverterBigDecimal, PmConverterDouble, PmConverterInteger, PmConverterLong, PmConverterShort

public class PmConverterNumber<T extends java.lang.Number>
extends PmConverterSerializeableBase<T>

Base class for number type converters.

Author:
olaf boede

Constructor Summary
PmConverterNumber(java.lang.Class<T> numberClass)
           
 
Method Summary
protected  java.text.NumberFormat getNumberFormat(PmAttr<?> pmAttr)
           
 T stringToValue(PmAttr<?> pmAttr, java.lang.String s)
           
 
Methods inherited from class org.pm4j.core.pm.impl.converter.PmConverterSerializeableBase
serializeableToValue, valueToSerializable, valueToString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PmConverterNumber

public PmConverterNumber(java.lang.Class<T> numberClass)
Method Detail

stringToValue

public T stringToValue(PmAttr<?> pmAttr,
                       java.lang.String s)

getNumberFormat

protected java.text.NumberFormat getNumberFormat(PmAttr<?> pmAttr)
Parameters:
pmAttr - The attribute. Provides the language context.
Returns:
The associated number format.
In case of an empty or null result of PmAttr.getFormatString(), a DecimalFormat for the current locale of the given pmAttr will be returned.