use of org.apache.tapestry5.internal.translator.StringTranslator in project tapestry-5 by apache.
the class TapestryModule method contributeTranslatorSource.
/**
* Contributes the basic set of translators:
* <ul>
* <li>string</li>
* <li>byte</li>
* <li>short</li>
* <li>integer</li>
* <li>long</li>
* <li>float</li>
* <li>double</li>
* <li>BigInteger</li>
* <li>BigDecimal</li>
* </ul>
*/
public static void contributeTranslatorSource(MappedConfiguration<Class, Translator> configuration, NumericTranslatorSupport support, Html5Support html5Support) {
configuration.add(String.class, new StringTranslator());
Class[] types = new Class[] { Byte.class, Short.class, Integer.class, Long.class, Float.class, Double.class, BigInteger.class, BigDecimal.class };
for (Class type : types) {
String name = type.getSimpleName().toLowerCase();
configuration.add(type, new NumericTranslator(name, type, support, html5Support));
}
}
Aggregations