String fieldSpec = fieldNames.get(i).trim();
if (fieldSpec.equals("*")) {
return new RecordMetaData(recordName, fieldsMetaData, true);
} else {
FieldMetaData fieldMetaData;
if (fieldSpec.indexOf('?') >= 0) {
String fieldName = fieldSpec.substring(0, fieldSpec.indexOf('?'));
String functionDefinition = fieldSpec.substring(fieldSpec.indexOf('?') + 1);
fieldMetaData = new FieldMetaData(fieldName);
if (functionDefinition.length() != 0) {
fieldMetaData.setStringFunctionExecutor(StringFunctionExecutor.getInstance(functionDefinition));
}
} else {
fieldMetaData = new FieldMetaData(fieldSpec);
}
fieldsMetaData.add(fieldMetaData);
if (fieldMetaData.ignore() && fieldMetaData.getIgnoreCount() > 1
&& fieldMetaData.getIgnoreCount() < Integer.MAX_VALUE) {
// pad out with an FieldMetaData instance for each
// additionally ignored
// field in the record...
for (int ii = 0; ii < fieldMetaData.getIgnoreCount() - 1; ii++) {
fieldsMetaData.add(new FieldMetaData(FieldMetaData.IGNORE_FIELD));
}
}
}
}