use of com.sldeditor.common.datasource.DataSourceField in project sldeditor by robward-scisys.
the class MXDParser method processFields.
/**
* Process fields.
*
* @param layerName the layer name
* @param fieldArrayElement the field array element
* @return the list
*/
private List<DataSourceFieldInterface> processFields(String layerName, JsonElement fieldArrayElement) {
List<DataSourceFieldInterface> fieldList = new ArrayList<DataSourceFieldInterface>();
if (fieldArrayElement != null) {
JsonArray fieldArray = fieldArrayElement.getAsJsonArray();
for (int index = 0; index < fieldArray.size(); index++) {
JsonObject fieldObject = null;
try {
fieldObject = fieldArray.get(index).getAsJsonObject();
} catch (IllegalStateException e) {
ConsoleManager.getInstance().error(this, "Layer : " + layerName);
ConsoleManager.getInstance().exception(this, e);
}
if (fieldObject != null) {
Class<?> fieldType = convertFieldType(fieldObject.get("type").getAsString());
DataSourceField esriField = new DataSourceField(fieldObject.get("field").getAsString(), fieldType);
fieldList.add(esriField);
}
}
}
return fieldList;
}
Aggregations