Package org.relaxng.datatype

Examples of org.relaxng.datatype.DatatypeException


    // default implementation for concrete type. somewhat shabby.
    protected void _checkValid(String content, ValidationContext context) throws DatatypeException {
        if(checkFormat(content,context))    return;
       
        throw new DatatypeException(DatatypeException.UNKNOWN,
            localize(ERR_INAPPROPRIATE_FOR_TYPE, content, getName()) );
    }
View Full Code Here


        if( name.equals("IDREF") )
            return IDREFType.theInstance;
        if( name.equals("IDREFS") )
            return DatatypeFactory.getTypeByName("IDREFS");
       
        throw new DatatypeException("undefined built-in type:"+name);
    }
View Full Code Here

        return baseType;
    }
   
    public void addParameter( String name, String value, ValidationContext context )
            throws DatatypeException {
        throw new DatatypeException(
            localize(ERR_PARAMETER_UNSUPPORTED,null));
    }
View Full Code Here

    public Datatype createDatatype( String name ) throws DatatypeException {
        if( name.equals("string") )
            return com.sun.msv.datatype.xsd.StringType.theInstance;
        if( name.equals("token") )
            return com.sun.msv.datatype.xsd.TokenType.theInstance;
        throw new DatatypeException("undefined built-in type:"+name);
    }
View Full Code Here

        int r = baseType.isFacetApplicable(facetName);
        switch(r)
        {
        case APPLICABLE:    return;    // this facet is applicable to this type. no problem.
        case NOT_ALLOWED:
            throw new DatatypeException( localize(ERR_NOT_APPLICABLE_FACET, facetName) );
        case FIXED:
            throw new DatatypeException( localize(ERR_OVERRIDING_FIXED_FACET, facetName) );
        }
    }
View Full Code Here

        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.
    }
View Full Code Here

   
    protected void diagnoseByFacet(String content, ValidationContext context) throws DatatypeException {
        final int cnt = countPrecision(content);
        if( cnt<=precision )    return;
       
        throw new DatatypeException( DatatypeException.UNKNOWN,
            localize(ERR_TOO_MUCH_PRECISION, new Integer(cnt), new Integer(precision)) );
    }
View Full Code Here

        throws DatatypeException {
        xsdDatatypeLibrary =
            factory.createDatatypeLibrary(
                WellKnownNamespaces.XML_SCHEMA_DATATYPES);
        if (xsdDatatypeLibrary == null)
            throw new DatatypeException();

        if (type.equals("string") || type.equals("token")) {
            return new BuiltinDatatypeBuilder(
                xsdDatatypeLibrary.createDatatype(type));
        }
        throw new DatatypeException();
    }
View Full Code Here

        if (e instanceof DatatypeMismatchException) {
            datatypeErrors = ((DatatypeMismatchException) e).getExceptions();
        }
        if (datatypeErrors != null) {
            for (Map.Entry<String, DatatypeException> entry : datatypeErrors.entrySet()) {
                DatatypeException dex = entry.getValue();
                if (dex instanceof Html5DatatypeException) {
                    Html5DatatypeException ex5 = (Html5DatatypeException) dex;
                    if (ex5.isWarning()) {
                        this.warnings++;
                        throwIfTooManyMessages();
View Full Code Here

        MessageTextHandler messageTextHandler = emitter.startText();
        if (messageTextHandler != null) {
            boolean isWarning = false;
            Map<String, DatatypeException> datatypeErrors = e.getExceptions();
            for (Map.Entry<String, DatatypeException> entry : datatypeErrors.entrySet()) {
                DatatypeException dex = entry.getValue();
                if (dex instanceof Html5DatatypeException) {
                    Html5DatatypeException ex5 = (Html5DatatypeException) dex;
                    if (ex5.isWarning()) {
                        isWarning = true;
                    }
View Full Code Here

TOP

Related Classes of org.relaxng.datatype.DatatypeException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.