to.etc.domui.converter
Class EnumFactory

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

public class EnumFactory
extends java.lang.Object
implements IConverterFactory


Constructor Summary
EnumFactory()
           
 
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

EnumFactory

public EnumFactory()
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)