Example usage for org.apache.commons.beanutils ConvertUtilsBean2 register

List of usage examples for org.apache.commons.beanutils ConvertUtilsBean2 register

Introduction

In this page you can find the example usage for org.apache.commons.beanutils ConvertUtilsBean2 register.

Prototype

private void register(Class clazz, Converter converter) 

Source Link

Document

strictly for convenience since it has same parameter order as Map.put

Usage

From source file:io.milton.cloud.server.web.templating.DataBinder.java

public DataBinder() {
    ConvertUtilsBean2 convertUtilsBean = new ConvertUtilsBean2();
    DateTimeConverter dtConverter = new NullSafeDateTimeConverter();
    dtConverter.setPatterns(dateFormats);
    convertUtilsBean.register(dtConverter, Date.class);

    bub = new BeanUtilsBean(convertUtilsBean);
}

From source file:io.milton.http.annotated.DataBinder.java

public DataBinder() {
    ConvertUtilsBean2 convertUtilsBean = new ConvertUtilsBean2();
    NullSafeDateTimeConverter dtConverter = new NullSafeDateTimeConverter();
    dtConverter.setPatterns(dateFormats);
    convertUtilsBean.register(dtConverter, Date.class);

    BigDecimalConverter bdConverter = new BigDecimalConverter(null);
    convertUtilsBean.register(bdConverter, BigDecimal.class);

    bub = new BeanUtilsBean(convertUtilsBean);
}