Examples of Violation


Examples of org.apache.cocoon.components.validation.Violation

                while (assertIter.hasNext()) {
                    Assert assertion = (Assert) assertIter.next();

                    // add the next assert to the violations set
                    Violation v = new Violation();

                    v.setPath(rule.getContext());
                    v.setMessage(assertion.getMessage());
                    violations.add(v);
                    // System.out.println("        Assert test: " + assertion.getTest() + ", message: " + assertion.getMessage() );
                }

                Iterator reportIter = rule.getReport().iterator();

                while (reportIter.hasNext()) {
                    Report report = (Report) reportIter.next();

                    // add the next report to the violations set
                    Violation v = new Violation();

                    v.setPath(rule.getContext());
                    v.setMessage(report.getMessage());
                    violations.add(v);
                    // System.out.println("        Report test: " + report.getTest() + ", message: " + report.getMessage() );
                }
            }
        }
View Full Code Here

Examples of org.apache.cocoon.validation.Violation

        while (assertIter.hasNext ())
        {
          Assert anAssert = (Assert)assertIter.next ();

          // add the next assert to the violations set
          Violation v = new Violation();
          v.setPath( rule.getContext() );
          v.setMessage( anAssert.getMessage() );
          violations.add( v );
          // System.out.println("        Assert test: " + anAssert.getTest() + ", message: " + anAssert.getMessage() );
        }

        Iterator reportIter = rule.getReport().iterator();
        while (reportIter.hasNext ())
        {
          Report report = (Report)reportIter.next ();

          // add the next report to the violations set
          Violation v = new Violation();
          v.setPath( rule.getContext() );
          v.setMessage( report.getMessage() );
          violations.add( v );
          // System.out.println("        Report test: " + report.getTest() + ", message: " + report.getMessage() );
        }
      }
    }
View Full Code Here

Examples of org.apache.jena.iri.Violation

            throw new ExprEvalException("Relative IRI string: " + iriStr) ;
        if ( warningsForIRIs && iri.hasViolation(false) ) {
            String msg = "unknown violation from IRI library" ;
            Iterator<Violation> iter = iri.violations(false) ;
            if ( iter.hasNext() ) {
                Violation viol = iter.next() ;
                msg = viol.getShortMessage() ;
            }
            Log.warn(NodeFunctions.class, "Bad IRI: " + msg + ": " + iri) ;
        }
        return NodeFactory.createURI(iri.toString()) ;
    }
View Full Code Here

Examples of org.apache.jena.iri.Violation

           
            boolean errorSeen = false ;
            boolean warningSeen = false ;
           
            // What to finally report.
            Violation vError = null ;
            Violation vWarning = null ;
            Violation xvSub = null ;
           
            for ( ; iter.hasNext() ; )
            {
                Violation v = iter.next();
                int code = v.getViolationCode() ;
                boolean isError = v.isError() ;
               
                // Ignore these.
                if ( code == Violation.LOWERCASE_PREFERRED
                    ||
                    code == Violation.PERCENT_ENCODING_SHOULD_BE_UPPERCASE
                    ||
                    code == Violation.SCHEME_PATTERN_MATCH_FAILED
                    )
                    continue ;

                // Anything we want to reprioritise?
                // [nothing at present]
               
                // Remember first error and first warning.
                if ( isError )
                {
                    errorSeen = true ;
                    if ( vError == null )
                        // Remember first error
                        vError = v ;
                }
                else
                {
                    warningSeen = true ;
                    if ( vWarning == null )
                        vWarning = v ;
                }
               
                String msg = v.getShortMessage();
                String iriStr = iri.toString();

                // Ideally, we might want to output all messages relating to this IRI
                // then cause the error or continue.
                // But that's tricky given the current errorhandler architecture.
View Full Code Here

Examples of org.apache.jena.iri.Violation

        {
            String msg = "unknown violation from IRI library" ;
            Iterator<Violation> iter = iri.violations(false) ;
            if ( iter.hasNext() )
            {
                Violation viol = iter.next() ;
                msg = viol.getShortMessage() ;
            }
            Log.warn(NodeFunctions.class, "Bad IRI: "+msg+": "+iri) ;
        }
        return NodeFactory.createURI(iri.toString()) ;
    }
View Full Code Here

Examples of org.apache.jena.iri.Violation

        IRI iri = factory.create(string);
        if (iri.hasViolation(true)) {
            System.out.println("n: " + string);
            Iterator<Violation> it = iri.violations(true);
            while (it.hasNext()) {
                Violation v = it.next();
                System.out.println(v.getLongMessage());
            }
        } else {
            System.out.println("y: " + string);
        }
    }
View Full Code Here

Examples of org.apache.jena.iri.Violation

           
            boolean errorSeen = false ;
            boolean warningSeen = false ;
           
            // What to finally report.
            Violation vError = null ;
            Violation vWarning = null ;
            Violation xvSub = null ;
           
            for ( ; iter.hasNext() ; )
            {
                Violation v = iter.next();
                int code = v.getViolationCode() ;
                boolean isError = v.isError() ;
               
                // Ignore these.
                if ( code == Violation.LOWERCASE_PREFERRED
                    ||
                    code == Violation.PERCENT_ENCODING_SHOULD_BE_UPPERCASE
                    ||
                    code == Violation.SCHEME_PATTERN_MATCH_FAILED
                    )
                    continue ;

                // Anything we want to reprioritise?
                // [nothing at present]
               
                // Remember first error and first warning.
                if ( isError )
                {
                    errorSeen = true ;
                    if ( vError == null )
                        // Remember first error
                        vError = v ;
                }
                else
                {
                    warningSeen = true ;
                    if ( vWarning == null )
                        vWarning = v ;
                }
               
                String msg = v.getShortMessage();
                String iriStr = iri.toString();

                // Ideally, we might want to output all messages relating to this IRI
                // then cause the error or continue.
                // But that's tricky given the current errorhandler architecture.
View Full Code Here

Examples of org.apache.jena.iri.Violation

    @Override
    public void runTest() {
        IRI iri = f.create(uri);
        Iterator<Violation> it = iri.violations(true);
        while (it.hasNext()) {
            Violation v = it.next();
            printErrorMessages(v);
           
        }
    }
View Full Code Here

Examples of org.apache.jena.iri.Violation

        }
        boolean hasError = false;
        boolean hasWarning = false;
        Iterator<Violation> it = iri.violations(true);
        while (it.hasNext()) {
            Violation v = it.next();
            if (v.getViolationCode() == violation.getCode()) {
                if (v.isError()) {
                    if (!expectError)
                        fail("Unexpected error, "+desc);
                    hasError = true;
                } else {
                    if (!expectWarning)
View Full Code Here

Examples of org.apache.jena.iri.Violation

        }
        boolean hasError = false;
        boolean hasWarning = false;
        Iterator<Violation> it = iri.violations(true);
        while (it.hasNext()) {
            Violation v = it.next();
            if (v.getViolationCode() == violation.getCode()) {
                if (v.isError()) {
                    if (!expectError)
                        fail("Unexpected error, "+desc);
                    hasError = true;
                } else {
                    if (!expectWarning)
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.