to.etc.domui.converter
Class DoubleFactory

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

public final class DoubleFactory
extends java.lang.Object
implements IConverterFactory

Generic factory to accept double numeric values. This has a low priority so monetary values can override this.

Author:
Frits Jalvingh Created on Nov 17, 2009

Constructor Summary
DoubleFactory()
           
 
Method Summary
 int accept(java.lang.Class<?> clz, PropertyMetaModel<?> pmm)
          This must decide whether to accept the class and property model pair.
<X,T extends IConverter<X>>
T
createConverter(java.lang.Class<X> clz, PropertyMetaModel<X> pmm)
          Return the converter which properly converts the specified class and meta model.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DoubleFactory

public DoubleFactory()
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:

createConverter

public <X,T extends IConverter<X>> T createConverter(java.lang.Class<X> clz,
                                                     PropertyMetaModel<X> pmm)
Description copied from interface: IConverterFactory
Return the converter which properly converts the specified class and meta model.

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