Package org.jibx.schema.validation

Examples of org.jibx.schema.validation.ValidationProblem


        ValidationContext vctx = new ValidationContext();
        loadCustomizations(path, new ClassSourceLocator(spaths), vctx);
        ArrayList probs = vctx.getProblems();
        if (probs.size() > 0) {
            for (int i = 0; i < probs.size(); i++) {
                ValidationProblem prob = (ValidationProblem)probs.get(i);
                System.out.print(prob.getSeverity() >=
                    ValidationProblem.ERROR_LEVEL ? "Error: " : "Warning: ");
                System.out.println(prob.getDescription());
            }
            if (vctx.getErrorCount() > 0 || vctx.getFatalCount() > 0) {
                return false;
            }
        }
View Full Code Here


        ((IUnmarshallable)custom).unmarshal(ictx);
        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() >=
                    ValidationProblem.ERROR_LEVEL ? "Error: " : "Warning: ");
                buff.append(prob.getDescription());
                buff.append('\n');
            }
            fail(buff.toString());
        }
        custom.fillClasses();
View Full Code Here

    private static boolean reportProblems(ValidationContext vctx) {
        ArrayList probs = vctx.getProblems();
        boolean error = false;
        if (probs.size() > 0) {
            for (int j = 0; j < probs.size(); j++) {
                ValidationProblem prob = (ValidationProblem)probs.get(j);
                String text;
                if (prob.getSeverity() >= ValidationProblem.ERROR_LEVEL) {
                    error = true;
                    text = "Error: " + prob.getDescription();
                    s_logger.error(text);
                } else {
                    text = "Warning: " + prob.getDescription();
                    s_logger.info(text);
                }
                System.out.println(text);
            }
        }
View Full Code Here

        StringWriter writer = new StringWriter();
        writer.append("Problems found in schema definition");
        ArrayList problems = vctx.getProblems();
        for (int i = 0; i < problems.size(); i++) {
            writer.append('\n');
            ValidationProblem prob = (ValidationProblem)problems.get(i);
            writer.append(prob.getDescription());
        }
        return writer.toString();
    }
View Full Code Here

            ((IUnmarshallable)m_customRoot).unmarshal(ictx);
        }
        ArrayList probs = vctx.getProblems();
        if (probs.size() > 0) {
            for (int i = 0; i < probs.size(); i++) {
                ValidationProblem prob = (ValidationProblem)probs.get(i);
                System.out.print(prob.getSeverity() >=
                    ValidationProblem.ERROR_LEVEL ? "Error: " : "Warning: ");
                System.out.println(prob.getDescription());
            }
            if (vctx.getErrorCount() > 0 || vctx.getFatalCount() > 0) {
                return false;
            }
        }
View Full Code Here

        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() >=
                    ValidationProblem.ERROR_LEVEL ? "Error: " : "Warning: ");
                buff.append(prob.getDescription());
                buff.append('\n');
            }
            fail(buff.toString());
        }
        global.fillClasses();
View Full Code Here

TOP

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

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.