use of org.opengis.util.ScopedName in project sis by apache.
the class AbstractFeature method propertyNotFound.
/**
* Returns the exception message for a property not found. The message will differ depending
* on whether the property is not found because ambiguous or because it does not exist.
*
* @param feature the name of the feature where a property where searched ({@link String} or {@link GenericName}).
* @param property the name of the property which has not been found.
*/
static String propertyNotFound(final FeatureType type, final Object feature, final String property) {
GenericName ambiguous = null;
for (final AbstractIdentifiedType p : type.getProperties(true)) {
final GenericName next = p.getName();
GenericName name = next;
do {
if (property.equalsIgnoreCase(name.toString())) {
if (ambiguous == null) {
ambiguous = next;
} else {
return Errors.format(Errors.Keys.AmbiguousName_3, ambiguous, next, property);
}
}
} while (name instanceof ScopedName && (name = ((ScopedName) name).tail()) != null);
}
return Resources.format(Resources.Keys.PropertyNotFound_2, feature, property);
}
Aggregations