Examples of Violation


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

    {
        IRI iri = IRIFactory.iriImplementation().create(s) ;
        System.out.println(">> "+iri) ;
        for ( Iterator<Violation> iter = iri.violations(true) ; iter.hasNext() ; )
        {
            Violation v = iter.next();
            System.out.println(v.getShortMessage()) ;
        }
        System.out.println("<< "+iri) ;
        System.out.println() ;
    }
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

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

    protected static void checkURI(XMLHandler forErrors, Taint taintMe, IRI rslt)
            throws SAXParseException {
        if (rslt.hasViolation(false)) {
            Iterator<Violation> it = rslt.violations(false);
            while (it.hasNext()) {
                Violation irie = it.next();
                // if (irie.getViolationCode() ==
                // ViolationCodes.REQUIRED_COMPONENT_MISSING)
                String msg = irie.getShortMessage();
                String uri = rslt.toString();
//                if (msg.endsWith(uri)) {
//                    msg = msg.substring(0, msg.length() - uri.length()) + "<"
//                            + uri + ">";
//                } else {
//                    msg = "<" + uri + "> " + msg;
//                }
                if (irie.getViolationCode() == ViolationCodes.REQUIRED_COMPONENT_MISSING
                        && irie.getComponent() == IRIComponents.SCHEME) {
                    if (!forErrors.allowRelativeURIs())
                        forErrors.warning(taintMe, WARN_RELATIVE_URI,
                                "Relative URIs are not permitted in RDF: specifically <"
                                        + rslt.toString() + ">");
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 Node.createURI(iri.toString()) ;
    }
View Full Code Here

Examples of org.epic.perleditor.editors.util.PodChecker.Violation

     * java.lang.Object)
     */
    protected Map createMarkerAttributes(MarkerUtilities factory, Object violation)
    {
        Map attributes = new HashMap(3);
        Violation v = (Violation) violation;

        int severity;
        if ("error".equalsIgnoreCase(v.severity))
        {
            severity = IMarker.SEVERITY_ERROR;
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.