to.etc.domui.converter
Interface IConverterFactory

All Known Implementing Classes:
BooleanConverterFactory, DateConverterFactory, DefaultConverterFactory, DomainListConverterFactory, DoubleFactory, EnumFactory, MoneyConverterFactory

public interface IConverterFactory

A factory for creating IConverters to convert values.

Author:
Frits Jalvingh Created on Dec 30, 2008

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.
 

Method Detail

accept

int accept(java.lang.Class<?> clz,
           PropertyMetaModel<?> pmm)
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.

Parameters:
clz -
pmm -
Returns:

createConverter

<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.

Parameters:
clz -
pmm -
Returns: