@param value The value to be checked
@throws OntologyException If the value is not valid
*/
public void validate(AbsObject value, Ontology onto) throws OntologyException {
if (!(value instanceof AbsPrimitive)) {
throw new OntologyException(value+" is not an AbsPrimitive");
}
AbsPrimitive absPrimitive = (AbsPrimitive) value;
Object absValue = absPrimitive.getObject();
if (absValue != null && permittedValues != null) {
for (int i=0; i<permittedValues.length; i++) {
if (absValue.equals(permittedValues[i])) {
return;
}
}
throw new OntologyException(value+" is not a permitted value ("+getPermittedValuesAsString()+")");
}
}