Package org.relaxng.datatype

Examples of org.relaxng.datatype.DatatypeException


        String o1typeName = o1.getName();
        String o2typeName = o2.getName();

        if (o1typeName.equals(o2typeName))
            // o1typeName==o2typeName==newName
            return new DatatypeException(
                XSDatatypeImpl.localize(XSDatatypeImpl.ERR_INCONSISTENT_FACETS_1, facetName1, facetName2));

        if (o1typeName.equals(newName))
            // o2 must be specified in somewhere in the derivation chain
            return new DatatypeException(
                XSDatatypeImpl.localize(
                    XSDatatypeImpl.ERR_INCONSISTENT_FACETS_2,
                    facetName1,
                    o2.displayName(),
                    facetName2));

        if (o2typeName.equals(newName))
            // vice versa
            return new DatatypeException(
                XSDatatypeImpl.localize(
                    XSDatatypeImpl.ERR_INCONSISTENT_FACETS_2,
                    facetName2,
                    o1.displayName(),
                    facetName1));
View Full Code Here


            } catch (NumberFormatException ee) {
                ;
            }
        }

        throw new DatatypeException(
            XSDatatypeImpl.localize(XSDatatypeImpl.ERR_FACET_MUST_BE_POSITIVE_INTEGER, facetName));
    }
View Full Code Here

                return value;
        } catch (NumberFormatException e) {
            ;
        }

        throw new DatatypeException(
            XSDatatypeImpl.localize(XSDatatypeImpl.ERR_FACET_MUST_BE_NON_NEGATIVE_INTEGER, facetName));
    }
View Full Code Here

        if( baseType.whiteSpace.tightness() > this.whiteSpace.tightness() ) {
            XSDatatype d;
            d=baseType.getFacetObject(FACET_WHITESPACE);
            if(d==null)    d = getConcreteType();
           
            throw new DatatypeException( localize(
                ERR_LOOSENED_FACET,    FACET_WHITESPACE, d.displayName() ));
        }
       
        // consistency with minLength/maxLength is checked in XSDatatypeImpl.derive method.
    }
View Full Code Here

     */
    public UnionType( String nsUri, String newTypeName, XSDatatype[] memberTypes ) throws DatatypeException {
        super(nsUri,newTypeName);

        if(memberTypes.length==0)
            throw new DatatypeException(localize(ERR_EMPTY_UNION));
       
        XSDatatypeImpl[] m = new XSDatatypeImpl[memberTypes.length];
        System.arraycopy( memberTypes, 0, m, 0, memberTypes.length );
       
        for( int i=0; i<m.length; i++ )
            if( m[i].isFinal(DERIVATION_BY_UNION) )
                throw new DatatypeException(localize(
                    ERR_INVALID_MEMBER_TYPE, m[i].displayName() ));
       
        this.memberTypes = m;
    }
View Full Code Here

    }
   
    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();
    }
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

        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

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