this.fBaseValidator.validate( content, state );
}
if ( (fFacetsDefined & DatatypeValidator.FACET_MAXLENGTH) != 0 ) {
if ( content.length() > fMaxLength ) {
throw new InvalidDatatypeValueException("Value '"+content+
"' with length '"+content.length()+
"' exceeds maximum length facet of '"+fMaxLength+"'.");
}
}
if ( (fFacetsDefined & DatatypeValidator.FACET_MINLENGTH) != 0 ) {
if ( content.length() < fMinLength ) {
throw new InvalidDatatypeValueException("Value '"+content+
"' with length '"+content.length()+
"' is less than minimum length facet of '"+fMinLength+"'." );
}
}
if ( (fFacetsDefined & DatatypeValidator.FACET_LENGTH) != 0 ) {
if ( content.length() != fLength ) {
throw new InvalidDatatypeValueException("Value '"+content+
"' with length '"+content.length()+
"' is not equal to length facet '"+fLength+"'.");
}
}
if ( (fFacetsDefined & DatatypeValidator.FACET_ENUMERATION) != 0 ) {
if ( fEnumeration.contains( content ) == false )
throw new InvalidDatatypeValueException("Value '"+content+"' must be one of "+fEnumeration);
}
/* Per October 23 CR - facets don't apply to StringValidator
if ( isMaxExclusiveDefined == true ) {
int comparisonResult;
comparisonResult = compare( content, fMaxExclusive );
if ( comparisonResult >= 0 ) {
throw new InvalidDatatypeValueException( "MaxExclusive:Value '"+content+ "' must be " +
"lexicographically less than" + fMaxExclusive );
}
}
if ( isMaxInclusiveDefined == true ) {
int comparisonResult;
comparisonResult = compare( content, fMaxInclusive );
if ( comparisonResult > 0 )
throw new InvalidDatatypeValueException( "MaxInclusive:Value '"+content+ "' must be " +
"lexicographically less or equal than" + fMaxInclusive );
}
if ( isMinExclusiveDefined == true ) {
int comparisonResult;
comparisonResult = compare( content, fMinExclusive );
//System.out.println( "exclusive = " + comparisonResult );
if ( comparisonResult <= 0 )
throw new InvalidDatatypeValueException( "MinExclusive:Value '"+content+ "' must be " +
"lexicographically greater than" + fMinExclusive );
}
if ( isMinInclusiveDefined == true ) {
int comparisonResult;
comparisonResult = compare( content, fMinInclusive );
//System.out.println( "inclusive = " + comparisonResult );
if ( comparisonResult < 0 )
throw new InvalidDatatypeValueException( "MinInclusive:Value '"+content+ "' must be " +
"lexicographically greater or equal than '" + fMinInclusive + "'." );
}
*/
if ( (fFacetsDefined & DatatypeValidator.FACET_PATTERN ) != 0 ) {
//RegularExpression regex = new RegularExpression(fPattern );
if ( fRegex == null || fRegex.matches( content) == false )
throw new InvalidDatatypeValueException("Value '"+content+
"' does not match regular expression facet '" + fPattern + "'." );
}
}