Package org.araneaframework.uilib.list.util

Examples of org.araneaframework.uilib.list.util.Converter


  protected void readBeanField(ResultSet resultSet, Object bean, String field)
  throws SQLException {
   
    String resultSetColumnName = (String) this.beanToResultSetMapping
    .get(field);
    Converter deconverter = (Converter) this.beanDeconverters.get(field);
   
    log.debug("Reading VO field '" + field + "' from ResultSet column '"
        + resultSetColumnName + "'.");
   
    Class valueType;
    if (deconverter != null) {
      valueType = deconverter.getDestinationType();
    } else {
      valueType = this.beanMapper.getBeanFieldType(field);
    }
   
    Object value = this.resultSetReader.readFromResultSet(
        resultSetColumnName, resultSet, valueType);
    if (deconverter != null) {
      value = deconverter.reverseConvert(value);
    }
    this.beanMapper.setBeanFieldValue(bean, field, value);
   
    log.debug("Read VO field '" + field + "' from ResultSet column '"
        + resultSetColumnName + "' with value '" + value + "'.");
View Full Code Here


    manager.addGlobalConverter(new DummyConverter());
   
    Iterator i = this.valueConverters.keySet().iterator();
    while (i.hasNext()) {
      String valueName = (String) i.next();
      Converter converter = (Converter) this.valueConverters
      .get(valueName);
      if (converter != null) {
        manager.addConverter(valueName, converter);
      }
    }
View Full Code Here

    if (this.globalConverter == null && this.converters.size() == 0) {
      throw new RuntimeException("No converters provided");
    }
    String name = value.getName();
    if (name != null) {
      Converter converter = (Converter) this.converters.get(name);
      if (converter != null) {
        return converter.convert(value.getValue());
      }
    }
    if (this.globalConverter != null) {
      return this.globalConverter.convert(value.getValue());
    }
View Full Code Here

  public MockValueConverter() {
    this.converters = new HashMap();
  }

  public Object convert(Value value) {
    Converter converter = (Converter) this.converters.get(value.getName());
    if (converter != null) {
      return converter.convert(value.getValue());
    }
    return value.getValue();
  }
View Full Code Here

TOP

Related Classes of org.araneaframework.uilib.list.util.Converter

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.