field.setDataTypeParameters(component.getTypeParameters());
return field;
}
private static Field copyField(Field oldField, boolean isMandatory) {
Field field = new Field();
field.setName(oldField.getName());
field.setXmltag(XmlTagEncoder.encode(oldField.getXmltag()));
field.setNodeTypeRef(oldField.getNodeTypeRef());
field.setDocumentation(oldField.getDocumentation());
field.setMaxLength(oldField.getMaxLength());
field.setMinLength(oldField.getMinLength());
field.setRequired(isMandatory);
field.setTruncatable(true);
field.setDataType(oldField.getDataType());
field.setDataTypeParameters(oldField.getTypeParameters());
field.getComponents().addAll(oldField.getComponents());
return field;
}