Package com.ebay.xcelite.annotations

Examples of com.ebay.xcelite.annotations.AnyColumn


            String.format("AnyColumn field \"%s\" should be of type Map.class or assignable from Map.class",
                anyColumnField.getName()));
      }
      anyColumn = new Col(anyColumnField.getName(), anyColumnField.getName());
      anyColumn.setAnyColumn(true);
      AnyColumn annotation = anyColumnField.getAnnotation(AnyColumn.class);
      anyColumn.setType(annotation.as());
      if (annotation.converter() != NoConverterClass.class) {
        anyColumn.setConverter(annotation.converter());
      }
    }   
  }
View Full Code Here


    }
    return blankRow;
  }

  private boolean isColumnInIgnoreList(Field anyColumnField, String columnName) {
    AnyColumn annotation = anyColumnField.getAnnotation(AnyColumn.class);
    Set<String> ignoreCols = Sets.newHashSet(annotation.ignoreCols());   
    return ignoreCols.contains(columnName);
  }
View Full Code Here

  private void writeToAnyColumnField(Field field, T object, Cell cell, String columnName) {
    try {
      field.setAccessible(true);
      Object value = readValueFromCell(cell);
      if (value != null) {
        AnyColumn annotation = field.getAnnotation(AnyColumn.class);
        if (field.get(object) == null) {
          Map<String, Object> map = (Map<String, Object>) annotation.as().newInstance();
          field.set(object, map);
        }
        Map<String, Object> map = (Map<String, Object>) field.get(object);       
        if (annotation.converter() != NoConverterClass.class) {
          ColumnValueConverter<Object, ?> converter = (ColumnValueConverter<Object, ?>) annotation.converter()
              .newInstance();
          value = converter.deserialize(value);
        }      
        map.put(columnName, value);
      }
View Full Code Here

TOP

Related Classes of com.ebay.xcelite.annotations.AnyColumn

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.