to.etc.domui.converter
Class MoneyConverterFactory

java.lang.Object
  extended by to.etc.domui.converter.MoneyConverterFactory
All Implemented Interfaces:
IConverterFactory

public class MoneyConverterFactory
extends java.lang.Object
implements IConverterFactory


Constructor Summary
MoneyConverterFactory()
           
 
Method Summary
 int accept(java.lang.Class<?> clz, PropertyMetaModel<?> pmm)
          This must decide whether to accept the class and property model pair.
static IConverter<java.math.BigDecimal> createBigDecimalMoneyConverters(NumericPresentation np)
          Returns one of the converter classes for converting a double into one of the numericPresentations.
<X,T extends IConverter<X>>
T
createConverter(java.lang.Class<X> clz, PropertyMetaModel<X> pmm)
          Create the appropriate converter.
static IConverter<java.lang.Double> createDoubleMoneyConverters(NumericPresentation np)
          Returns one of the converter classes for converting a double into one of the numericPresentations.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MoneyConverterFactory

public MoneyConverterFactory()
Method Detail

accept

public int accept(java.lang.Class<?> clz,
                  PropertyMetaModel<?> pmm)
Description copied from interface: IConverterFactory
This must decide whether to accept the class and property model pair. This must return a score which is used to decide the best converter to use; the higher the score the better the chance of this converter being used. If this converter does not accept the class it must return -1. If the class is accepted but the PropertyMetaModel passed was unacceptable this must return 0.

Specified by:
accept in interface IConverterFactory
Returns:

createDoubleMoneyConverters

public static IConverter<java.lang.Double> createDoubleMoneyConverters(NumericPresentation np)
Returns one of the converter classes for converting a double into one of the numericPresentations.

Parameters:
pmm -
Returns:

createBigDecimalMoneyConverters

public static IConverter<java.math.BigDecimal> createBigDecimalMoneyConverters(NumericPresentation np)
Returns one of the converter classes for converting a double into one of the numericPresentations.

Parameters:
pmm -
Returns:

createConverter

public <X,T extends IConverter<X>> T createConverter(java.lang.Class<X> clz,
                                                     PropertyMetaModel<X> pmm)
Create the appropriate converter.

Specified by:
createConverter in interface IConverterFactory
Returns:
See Also:
IConverterFactory.createConverter(java.lang.Class, to.etc.domui.component.meta.PropertyMetaModel)