Ejemplo n.º 1
0
  /** configure. */
  static void configureBeanUtils() {
    BeanUtilsBean beanUtilsBean = BeanUtilsBean.getInstance();

    if (beanUtilsBean.getClass() != BeanUtilsBean.class) {
      throw new IllegalStateException(
          "Someone has already switched the default org.apache.commons.beanutils.BeanUtilsBean instance"); //$NON-NLS-1$
    }

    if (beanUtilsBean.getConvertUtils().getClass() != ConvertUtilsBean.class) {
      throw new IllegalStateException(
          "Someone has already switched the default org.apache.commons.beanutils.ConvertUtilsBean instance"); //$NON-NLS-1$
    }

    BeanUtilsBean.setInstance(new BeanUtilsBean(new EnumAwareConvertUtilsBean()));

    DateTimeConverter dtConverter = new DateConverter();
    dtConverter.setPattern(Bo2UtilsEnvironment.getIsoDateFormatPattern());
    ConvertUtils.register(dtConverter, java.util.Date.class);
  }
Ejemplo n.º 2
0
 /** Creates new {@link EntityImporter} instance. */
 public EntityImporter() {
   super();
   this.clazz = getTypeParameterClass();
   BeanUtilsBean.setInstance(new BeanUtilsBean(new EnumAwareConvertUtilsBean()));
 }