Package org.jibx.schema.validation

Examples of org.jibx.schema.validation.ValidationContext


            String ns = uctx.getAttributeNamespace(i);
            if (ns == null || ns.length() == 0) {
               
                // check if schema attribute in allowed set
                if (attrs.indexOf(name) < 0) {
                    ValidationContext vctx = (ValidationContext)ictx.getUserContext();
                    vctx.addError("Undefined attribute " + name, ictx.getStackTop());
                }
               
            } else if (SCHEMA_NAMESPACE.equals(ns)) {
               
                // no attributes from schema namespace are defined
                ValidationContext vctx = (ValidationContext)ictx.getUserContext();
                vctx.addError("Undefined attribute " + name, ictx.getStackTop());
               
            } else if (!extra) {
               
                // warn on non-schema attribute present where forbidden
                ValidationContext vctx = (ValidationContext)ictx.getUserContext();
                String qname = UnmarshallingContext.buildNameString(ns, name);
                vctx.addWarning("Non-schema attribute not allowed " + qname, ictx.getStackTop());
               
            }
        }
    }
View Full Code Here


     */
    protected GlobalCustom readCustom(InputStream is)
        throws Exception {
        IUnmarshallingContext ictx =
            m_bindingFactory.createUnmarshallingContext();
        ValidationContext vctx = new ValidationContext();
        ictx.setDocument(is, null);
        ictx.setUserContext(vctx);
        GlobalCustom global = (GlobalCustom)ictx.unmarshalElement();
        List problems = vctx.getProblems();
        if (problems.size() > 0) {
            StringBuffer buff = new StringBuffer();
            for (int i = 0; i < problems.size(); i++) {
                ValidationProblem prob = (ValidationProblem)problems.get(i);
                buff.append(prob.getSeverity() >=
View Full Code Here

     */
    public CodeGen(SchemasetCustom global, URL root, File target) {
        m_global = global;
        addDefaultSubstitutions(m_global);
        m_targetDir = target;
        m_validationContext = new ValidationContext();
    }
View Full Code Here

TOP

Related Classes of org.jibx.schema.validation.ValidationContext

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.