//
Map<String, EAttribute> eAttrMap = EFeatureUtils.eGetAttributeMap(eClass);
//
// 3) Validate ID attribute
//
EAttribute eAttribute = eClass.getEIDAttribute();
if (eAttribute != null) {
//
// Get attribute name
//
String eName = eAttribute.getName();
//
// Get EAttribute ID instance
//
EFeatureAttributeInfo eInfo = eGetAttributeInfo(eName, true);
//
// Validate attribute
//
if(!(s = eInfo.validate(true, eAttribute)).isSuccess()) {
//
// Given EClass specified ID attribute was not a valid
//
return s;
}
} else if (!eAttrMap.containsKey(eIDAttributeName)) {
return failure(this, eName(), "Feature mismatch: ID EAttribute '" + eIDAttributeName + "' not found");
}
//
// EClass specified ID attribute is already validated
//
eAttrMap.remove(eAttribute);
//
// 4) Validate attributes
//
for (EFeatureAttributeInfo it : eAttributeInfoMap.values()) {
eAttribute = eAttrMap.get(it.eName);
if (eAttribute == null) {
return failure(this, eName(), "Feature mismatch: EAttribute " + it.eName
+ " not found in EClass");
}
boolean isID = eAttribute.getName().equals(eIDAttributeName);
if (!(s = it.validate(isID, eAttribute)).isSuccess()) {
return s;
}
}
//
// 5) Validate geometries
//
for (EFeatureGeometryInfo it : eGeometryInfoMap.values()) {
eAttribute = eAttrMap.get(it.eName);
if (eAttribute == null) {
return failure(this, eName(), "Feature mismatch: EGeometry " + it.eName
+ " not found in EClass");
}
boolean isID = eAttribute.getName().equals(eIDAttributeName);
if (!(s = it.validate(isID, eAttribute)).isSuccess()) {
return s;
}
}
//