Object facetDataValue=facetValue.getDataValue();
if ((XSD_NS+"minLength").equals(facetURI) || (XSD_NS+"maxLength").equals(facetURI) || (XSD_NS+"length").equals(facetURI)) {
if (facetDataValue instanceof Integer) {
int value=(Integer)facetDataValue;
if (value<0 || value==Integer.MAX_VALUE)
throw new UnsupportedFacetException("Facet with URI '"+facetURI+"' does not support integer "+value+" as value.");
}
else
throw new UnsupportedFacetException("Facet with URI '"+facetURI+"' does not support value of type "+facetValue.getClass()+" as value.");
}
else if ((XSD_NS+"pattern").equals(facetURI)) {
if (facetDataValue instanceof String) {
String pattern=(String)facetDataValue;
if (!RDFPlainLiteralPatternValueSpaceSubset.isValidPattern(pattern))
throw new UnsupportedFacetException("String '"+pattern+"' is not a valid regular expression.");
}
else
throw new UnsupportedFacetException("Facet with URI '"+facetURI+"' does not support value of type "+facetValue.getClass()+" as value.");
}
else if ((RDF_NS+"langRange").equals(facetURI)) {
if (!(facetDataValue instanceof String))
throw new UnsupportedFacetException("Facet with URI '"+facetURI+"' does not support '"+facetValue.toString()+"' as value.");
}
else
throw new UnsupportedFacetException("Facet with URI '"+facetURI+"' is not supported on rdf:PlainLiteral.");
}
}