Package org.relaxng.datatype

Examples of org.relaxng.datatype.DatatypeException


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


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

        // this method is never called.
        if(o==null)    throw new IllegalStateException();    // assertion
       
        int cnt = ((Discrete)concreteType).countLength(o);
        if(cnt!=length)
            throw new DatatypeException( DatatypeException.UNKNOWN,
                localize(ERR_LENGTH, new Integer(cnt), new Integer(length)) );
    }
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

       
        try {
            compileRegExps();
        } catch( ParseException pe ) {
            // in case regularExpression is not a correct pattern
            throw new DatatypeException( localize( ERR_PARSE_ERROR,
                pe.getMessage() ) );
        }
    }
View Full Code Here

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

        name = theCollapse.process(name);
        if (name.equals("preserve"))    return thePreserve;
        if (name.equals("collapse"))    return theCollapse;
        if (name.equals("replace"))     return theReplace;

        throw new DatatypeException(XSDatatypeImpl.localize(XSDatatypeImpl.ERR_INVALID_WHITESPACE_VALUE, name));
    }
View Full Code Here

    public void addParameter( String name, String value, ValidationContext context )
                    throws DatatypeException {
       
        if( name.equals(XSDatatype.FACET_ENUMERATION) )
            // the enumeration facet is not allowed for RELAX NG.
            throw new DatatypeException(
                XSDatatypeImpl.localize(XSDatatypeImpl.ERR_NOT_APPLICABLE_FACET, name) );
           
       
        incubator.addFacet( name, value, false, context );
       
View Full Code Here

        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.
    }
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.