use of com.runwaysdk.system.gis.geo.InvalidGeoEntityUniversalException in project geoprism-registry by terraframe.
the class ServerHierarchyType method validateUniversalRelationship.
public void validateUniversalRelationship(ServerGeoObjectType childType, ServerGeoObjectType parentType) {
// Total hack for super types
Universal childUniversal = childType.getUniversal();
Universal parentUniversal = parentType.getUniversal();
List<Term> ancestors = childUniversal.getAllAncestors(this.getUniversalType()).getAll();
if (!ancestors.contains(parentUniversal)) {
ServerGeoObjectType superType = childType.getSuperType();
if (superType != null) {
ancestors = superType.getUniversal().getAllAncestors(this.getUniversalType()).getAll();
}
}
if (!ancestors.contains(parentUniversal)) {
InvalidGeoEntityUniversalException exception = new InvalidGeoEntityUniversalException();
exception.setChildUniversal(childUniversal.getDisplayLabel().getValue());
exception.setParentUniversal(parentUniversal.getDisplayLabel().getValue());
exception.apply();
throw exception;
}
}
Aggregations