Package org.relaxng.datatype

Examples of org.relaxng.datatype.DatatypeException


        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

  }

  public void addParameter(String name,
         String value,
         ValidationContext context) throws DatatypeException {
    throw new DatatypeException(localizer.message("builtin_param"));
  }
View Full Code Here

            if (xsdDatatypeLibrary == null) {
                xsdDatatypeLibrary =
                    factory.createDatatypeLibrary(
                        WellKnownNamespaces.XML_SCHEMA_DATATYPES);
                if (xsdDatatypeLibrary == null)
                    throw new DatatypeException();
            }
            return xsdDatatypeLibrary.createDatatypeBuilder(type);
        }
        throw new DatatypeException();
    }
View Full Code Here

    // 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

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

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

                for( int i=1; i<members.length; i++ )
                    r+= "/\""+members[i].toString()+"\"";
               
                r = "("+r+")";    // oh, don't tell me I should use StringBuffer.
               
                throw new DatatypeException( DatatypeException.UNKNOWN,
                    localize(ERR_ENUMERATION_WITH_ARG, r) );
            }
        }
        throw new DatatypeException( DatatypeException.UNKNOWN,
            localize(ERR_ENUMERATION) );
    }
View Full Code Here

        }
       
        dt = (XSDatatype)builtinType.get(dataTypeName);
        if(dt!=null)        return dt;
       
        throw new DatatypeException("undefined type name:"+dataTypeName);
    }
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.