setBasetype( base );  fDerivedByList = derivedByList;  if ( facets != null  ){ for (Enumeration e = facets.keys(); e.hasMoreElements();) { String key = (String) e.nextElement(); if ( key.equals(SchemaSymbols.ELT_LENGTH) ) { fFacetsDefined += DatatypeValidator.FACET_LENGTH; String lengthValue = (String)facets.get(key); try { fLength     = Integer.parseInt( lengthValue ); } catch (NumberFormatException nfe) { throw new InvalidDatatypeFacetException("Length value '"+lengthValue+"' is invalid."); } if ( fLength < 0 ) throw new InvalidDatatypeFacetException("Length value '"+lengthValue+"'  must be a nonNegativeInteger.");  } else if (key.equals(SchemaSymbols.ELT_MINLENGTH) ) { fFacetsDefined += DatatypeValidator.FACET_MINLENGTH; String minLengthValue = (String)facets.get(key); try { fMinLength     = Integer.parseInt( minLengthValue ); } catch (NumberFormatException nfe) { throw new InvalidDatatypeFacetException("maxLength value '"+minLengthValue+"' is invalid."); } } else if (key.equals(SchemaSymbols.ELT_MAXLENGTH) ) { fFacetsDefined += DatatypeValidator.FACET_MAXLENGTH; String maxLengthValue = (String)facets.get(key); try { fMaxLength     = Integer.parseInt( maxLengthValue ); } catch (NumberFormatException nfe) { throw new InvalidDatatypeFacetException("maxLength value '"+maxLengthValue+"' is invalid."); } } else if (key.equals(SchemaSymbols.ELT_ENUMERATION)) { fFacetsDefined += DatatypeValidator.FACET_ENUMERATION; fEnumeration    = (Vector)facets.get(key); } else { throw new InvalidDatatypeFacetException("invalid facet tag : " + key); } } if (((fFacetsDefined & DatatypeValidator.FACET_LENGTH ) != 0 ) ) { if (((fFacetsDefined & DatatypeValidator.FACET_MAXLENGTH ) != 0 ) ) { throw new InvalidDatatypeFacetException( "It is an error for both length and maxLength to be members of facets." ); } else if (((fFacetsDefined & DatatypeValidator.FACET_MINLENGTH ) != 0 ) ) { throw new InvalidDatatypeFacetException( "It is an error for both length and minLength to be members of facets." ); } }  if ( ( (fFacetsDefined & ( DatatypeValidator.FACET_MINLENGTH | DatatypeValidator.FACET_MAXLENGTH) ) != 0 ) ) { if ( fMinLength > fMaxLength ) { throw new InvalidDatatypeFacetException( "Value of minLength = " + fMinLength + "must be greater that the value of maxLength" + fMaxLength ); } } }
    public ListDatatypeValidator ( DatatypeValidator base, Hashtable facets,                                      boolean derivedByList ) throws InvalidDatatypeFacetException {        setBasetype( base ); // Set base type         fDerivedByList = derivedByList;        if ( facets != null  ){            for (Enumeration e = facets.keys(); e.hasMoreElements();) {                String key = (String) e.nextElement();                if ( key.equals(SchemaSymbols.ELT_LENGTH) ) {                    fFacetsDefined += DatatypeValidator.FACET_LENGTH;                    String lengthValue = (String)facets.get(key);                    try {                        fLength     = Integer.parseInt( lengthValue );                    } catch (NumberFormatException nfe) {                        throw new InvalidDatatypeFacetException("Length value '"+lengthValue+"' is invalid.");                    }                    if ( fLength < 0 )                        throw new InvalidDatatypeFacetException("Length value '"+lengthValue+"'  must be a nonNegativeInteger.");                } else if (key.equals(SchemaSymbols.ELT_MINLENGTH) ) {                    fFacetsDefined += DatatypeValidator.FACET_MINLENGTH;                    String minLengthValue = (String)facets.get(key);                    try {                        fMinLength     = Integer.parseInt( minLengthValue );                    } catch (NumberFormatException nfe) {                        throw new InvalidDatatypeFacetException("maxLength value '"+minLengthValue+"' is invalid.");                    }                } else if (key.equals(SchemaSymbols.ELT_MAXLENGTH) ) {                    fFacetsDefined += DatatypeValidator.FACET_MAXLENGTH;                    String maxLengthValue = (String)facets.get(key);                    try {                        fMaxLength     = Integer.parseInt( maxLengthValue );                    } catch (NumberFormatException nfe) {                        throw new InvalidDatatypeFacetException("maxLength value '"+maxLengthValue+"' is invalid.");                    }                } else if (key.equals(SchemaSymbols.ELT_ENUMERATION)) {                    fFacetsDefined += DatatypeValidator.FACET_ENUMERATION;                    fEnumeration    = (Vector)facets.get(key);                } else {                    throw new InvalidDatatypeFacetException("invalid facet tag : " + key);                }            }            if (((fFacetsDefined & DatatypeValidator.FACET_LENGTH ) != 0 ) ) {                if (((fFacetsDefined & DatatypeValidator.FACET_MAXLENGTH ) != 0 ) ) {                    throw new InvalidDatatypeFacetException(                                                            "It is an error for both length and maxLength to be members of facets." );                  } else if (((fFacetsDefined & DatatypeValidator.FACET_MINLENGTH ) != 0 ) ) {                    throw new InvalidDatatypeFacetException(                                                            "It is an error for both length and minLength to be members of facets." );                }            }            if ( ( (fFacetsDefined & ( DatatypeValidator.FACET_MINLENGTH |                                        DatatypeValidator.FACET_MAXLENGTH) ) != 0 ) ) {                if ( fMinLength > fMaxLength ) {                    throw new InvalidDatatypeFacetException( "Value of minLength = " + fMinLength +                                                                "must be greater that the value of maxLength" + fMaxLength );                }            }        }// End of Facets Setting    }