public DatatypeBuilder createDatatypeBuilder(String type) throws DatatypeException { if (type.equals("token")) return tokenDatatypeBuilder; else if (type.equals("string")) return stringDatatypeBuilder; throw new DatatypeException(); } public Datatype createDatatype(String type) throws DatatypeException {
public void addParameter(String name, String value, ValidationContext context) throws DatatypeException { throw new DatatypeException(SchemaBuilderImpl.localizer.message("builtin_param")); }
RegexEngine getRegexEngine() throws DatatypeException { if (regexEngine == null) throw new DatatypeException(DatatypeBuilderImpl.localizer.message("regex_impl_not_found")); return regexEngine; }
protected void _checkValid(String content, ValidationContext context) throws DatatypeException { // what is the appropriate implementation for union? if( checkFormat(content,context) ) return; else throw new DatatypeException(); }
RegexEngine getRegexEngine() throws DatatypeException { if (regexEngine == null) throw new DatatypeException(DatatypeBuilderImpl.localizer.message("regex_impl_not_found")); return regexEngine; }
protected void diagnoseByFacet(String content, ValidationContext context) throws DatatypeException { if( checkLexicalConstraint(content) ) return; if( exps.length==1 ) throw new DatatypeException( DatatypeException.UNKNOWN, localize(ERR_PATTERN_1,patterns[0]) ); else throw new DatatypeException( DatatypeException.UNKNOWN, localize(ERR_PATTERN_MANY) ); }
protected void diagnoseByFacet(String content, ValidationContext context) throws DatatypeException { if( checkLexicalConstraint(content) ) return; if( exps.length==1 ) throw new DatatypeException( DatatypeException.UNKNOWN, localize(ERR_PATTERN_1,patterns[0]) ); else throw new DatatypeException( DatatypeException.UNKNOWN, localize(ERR_PATTERN_MANY) ); }
protected void diagnoseByFacet(String content, ValidationContext context) throws DatatypeException { Object o = concreteType._createValue(content,context); // base type must have accepted this lexical value, otherwise // this method is never called. if(o==null) throw new IllegalStateException(); // assertion int cnt = ((Discrete)concreteType).countLength(o); if(cnt>maxLength) throw new DatatypeException( DatatypeException.UNKNOWN, localize(ERR_MAXLENGTH, new Integer(cnt), new Integer(maxLength)) ); }
/** * derives a new datatype from atomic datatype by list */ public ListType( String nsUri, String newTypeName, XSDatatypeImpl itemType ) throws DatatypeException { super(nsUri,newTypeName); if(itemType.isFinal( DERIVATION_BY_LIST )) // derivation by list is not applicable throw new DatatypeException( localize(ERR_INVALID_ITEMTYPE) ); this.itemType = itemType; }
protected MinLengthFacet( String nsUri, String typeName, XSDatatypeImpl baseType, int _minLength, boolean _isFixed ) throws DatatypeException { super(nsUri,typeName,baseType,FACET_MINLENGTH,_isFixed); this.minLength = _minLength; // loosened facet check DataTypeWithFacet o = baseType.getFacetObject(FACET_MINLENGTH); if(o!=null && ((MinLengthFacet)o).minLength > this.minLength ) throw new DatatypeException( localize( ERR_LOOSENED_FACET, FACET_MINLENGTH, o.displayName() ) ); // consistency with maxLength is checked in XSDatatypeImpl.derive method. }
protected MaxLengthFacet( String nsUri, String typeName, XSDatatypeImpl baseType, int _maxLength, boolean _isFixed ) throws DatatypeException { super(nsUri,typeName,baseType,FACET_MAXLENGTH,_isFixed); this.maxLength = _maxLength; // loosened facet check DataTypeWithFacet o = baseType.getFacetObject(FACET_MAXLENGTH); if(o!=null && ((MaxLengthFacet)o).maxLength < this.maxLength ) throw new DatatypeException( localize( ERR_LOOSENED_FACET, FACET_MAXLENGTH, o.displayName() ) ); // consistency with minLength is checked in XSDatatypeImpl.derive method. }
protected MinLengthFacet( String nsUri, String typeName, XSDatatypeImpl baseType, int _minLength, boolean _isFixed ) throws DatatypeException { super(nsUri,typeName,baseType,FACET_MINLENGTH,_isFixed); this.minLength = _minLength; // loosened facet check DataTypeWithFacet o = baseType.getFacetObject(FACET_MINLENGTH); if(o!=null && ((MinLengthFacet)o).minLength > this.minLength ) throw new DatatypeException( localize( ERR_LOOSENED_FACET, FACET_MINLENGTH, o.displayName() ) ); // consistency with maxLength is checked in XSDatatypeImpl.derive method. }
public TotalDigitsFacet( String nsUri, String typeName, XSDatatypeImpl baseType, int _precision, boolean _isFixed ) throws DatatypeException { super( nsUri, typeName, baseType, FACET_TOTALDIGITS, _isFixed ); precision = _precision; // loosened facet check DataTypeWithFacet o = baseType.getFacetObject(FACET_TOTALDIGITS); if(o!=null && ((TotalDigitsFacet)o).precision < this.precision ) throw new DatatypeException( localize( ERR_LOOSENED_FACET, FACET_TOTALDIGITS, o.displayName() ) ); // consistency with scale is checked in XSDatatypeImpl.derive method. }
protected MinLengthFacet( String nsUri, String typeName, XSDatatypeImpl baseType, int _minLength, boolean _isFixed ) throws DatatypeException { super(nsUri,typeName,baseType,FACET_MINLENGTH,_isFixed); this.minLength = _minLength; // loosened facet check DataTypeWithFacet o = baseType.getFacetObject(FACET_MINLENGTH); if(o!=null && ((MinLengthFacet)o).minLength > this.minLength ) throw new DatatypeException( localize( ERR_LOOSENED_FACET, FACET_MINLENGTH, o.displayName() ) ); // consistency with maxLength is checked in XSDatatypeImpl.derive method. }
protected LengthFacet( String nsUri, String typeName, XSDatatypeImpl baseType, int _length, boolean _isFixed ) throws DatatypeException { super(nsUri,typeName,baseType,FACET_LENGTH,_isFixed); length = _length; // loosened facet check DataTypeWithFacet o = baseType.getFacetObject(FACET_LENGTH); if(o!=null && ((LengthFacet)o).length != this.length ) throw new DatatypeException( localize(ERR_LOOSENED_FACET, FACET_LENGTH, o.displayName() ) ); // consistency with minLength/maxLength is checked in XSDatatypeImpl.derive method. }
void checkRestriction(Object obj) throws DatatypeException { int actualLength = measure.getLength(obj); if (actualLength < length) throw new DatatypeException(localizer().message("min_length_violation", new Object[] { getDescriptionForRestriction(), length, actualLength })); } }
void checkRestriction(Object value) throws DatatypeException { if (!order.isLessThan(value, limit)) throw new DatatypeException(localizer().message("max_exclusive_violation", getDescriptionForRestriction(), limitString)); } }
void checkRestriction(Object value) throws DatatypeException { if (!order.isLessThan(value, limit)) throw new DatatypeException(localizer().message("max_exclusive_violation", getDescriptionForRestriction(), limitString)); } }
void checkRestriction(Object value) throws DatatypeException { if (!order.isLessThan(limit, value)) throw new DatatypeException(localizer().message("min_exclusive_violation", getDescriptionForRestriction(), limitString)); } }
void checkRestriction(Object value) throws DatatypeException { if (!order.isLessThan(limit, value) && !super.sameValue(value, limit)) throw new DatatypeException(localizer().message("min_inclusive_violation", getDescriptionForRestriction(), limitString)); } }