use of org.apache.apex.malhar.contrib.parser.DelimitedSchema.Field in project apex-malhar by apache.
the class DelimitedFSLoader method getProcessor.
/**
* Returns array of cellprocessors, one for each field
*/
private CellProcessor[] getProcessor(List<Field> fields) {
CellProcessor[] processor = new CellProcessor[fields.size()];
int fieldCount = 0;
for (Field field : fields) {
processor[fieldCount++] = CellProcessorBuilder.getCellProcessor(field.getType(), field.getConstraints());
}
return processor;
}
use of org.apache.apex.malhar.contrib.parser.DelimitedSchema.Field in project apex-malhar by apache.
the class CsvFormatter method getProcessor.
/**
* Returns array of cellprocessors, one for each field
*/
private CellProcessor[] getProcessor(List<Field> fields) {
CellProcessor[] processor = new CellProcessor[fields.size()];
int fieldCount = 0;
for (Field field : fields) {
if (field.getType() == FieldType.DATE) {
String format = field.getConstraints().get(DelimitedSchema.DATE_FORMAT) == null ? null : (String) field.getConstraints().get(DelimitedSchema.DATE_FORMAT);
processor[fieldCount++] = new Optional(new FmtDate(format == null ? "dd/MM/yyyy" : format));
} else {
processor[fieldCount++] = new Optional();
}
}
return processor;
}
use of org.apache.apex.malhar.contrib.parser.DelimitedSchema.Field in project apex-malhar by apache.
the class CsvParser method getProcessor.
/**
* Returns array of cellprocessors, one for each field
*/
private CellProcessor[] getProcessor(List<Field> fields) {
CellProcessor[] processor = new CellProcessor[fields.size()];
int fieldCount = 0;
for (Field field : fields) {
processor[fieldCount++] = CellProcessorBuilder.getCellProcessor(field.getType(), field.getConstraints());
}
return processor;
}
Aggregations