Package org.xml.sax

Examples of org.xml.sax.Locator


        cup.setNextProcess(process);
        cup.startProcess();

        XMLPipelineContext context = pipeline.getPipelineContext();
        Locator playLocator = player.getLocator();
        context.pushLocator(playLocator);
        manager = context.getFlowControlManager();
        try {
            player.setContentHandler(cup);
            player.setFlowController(this);
            player.play();
        } catch (SAXException x) {
            // Catching, logging and re-throwing because this exception may get lost
            // in case of IllegalStateException thrown inside finally
            logger.error(x);
            throw x;
        } finally {
            manager = null;

            Locator poppedLocator = (Locator) context.popLocator();
            if (poppedLocator != playLocator) {
                if (logger.isDebugEnabled()) {
                    String pushed = (null != playLocator) ? playLocator.getPublicId() : "null";
                    String popped = (null != poppedLocator) ? poppedLocator.getPublicId() : "null";
                    logger.debug("Popped locator does not match pushed locator." +
                            " Pushed: " + pushed +
                            " Popped: " + popped);
                }
                throw new IllegalStateException(
View Full Code Here


                    }
                }
                catch (Exception e) {
                    // something went wrong when evaluating the xpath.
                    // Send an error down the pipeline
                    Locator locator = pipelineContext.getCurrentLocator();
                    XMLPipelineException se = new XMLPipelineException(
                            "Could not evaluate the expression " +
                            expressionStr,
                            locator,
                            e);
View Full Code Here

        // Each request has a single operation and a single message. Both
        // of these should have been set as properties in the pipeline context
        // by the time we get here.
        XMLPipelineContext context = getPipelineContext();
        if (!context.inErrorRecoveryMode()) {
            Locator locator = context.getCurrentLocator();

            Operation operation =
                    (Operation)context.getProperty(Operation.class);
            if (operation == null) {
                String errorMessage =
View Full Code Here

    }

    // javadoc inherited from superclass
    public String getPublicId() {
        if (systemIdMatchesBaseURL()) {
            Locator locator = getCurrentLocator();
            return (locator != null) ? locator.getPublicId() : null;
        } else {
            return null;
        }
    }
View Full Code Here

        return baseAsString == null ? locatorSystemId == null :
                baseAsString.equals(locatorSystemId);
    }

    private String getLocatorSystemId() {
        Locator locator = getCurrentLocator();
        return (locator != null) ? locator.getSystemId() : null;
    }
View Full Code Here

    }

    // javadoc inherited from superclass
    public int getLineNumber() {
        if (systemIdMatchesBaseURL()) {
            Locator locator = getCurrentLocator();
            return (locator != null) ? locator.getLineNumber()
                    : LINE_UNAVAILABLE;
        } else {
            return LINE_UNAVAILABLE;
        }
    }
View Full Code Here

    }

    // javadoc inherited from superclass
    public int getColumnNumber() {
        if (systemIdMatchesBaseURL()) {
            Locator locator = getCurrentLocator();
            return (locator != null) ? locator.getColumnNumber()
                    : COLUMN_UNAVAILABLE;
        } else {
            return COLUMN_UNAVAILABLE;
        }
    }
View Full Code Here

        XMLPipelineContext context = getPipelineContext();

        // All elements should be in a different namespace from the
        // message.
        if (getProcessNamespaceURI().equals(namespace)) {
            Locator locator = context.getCurrentLocator();
            String message = "Message parts must be in a different " +
                    "namespace from the message";
            fatalError(new XMLStreamingException(message, locator));
        }
View Full Code Here

        // All elements should be in a different namespace from the
        // message.
        if (getProcessNamespaceURI().equals(namespace)) {
            XMLPipelineContext context = getPipelineContext();
            Locator locator = context.getCurrentLocator();
            String message = "Message parts must be in a different " +
                    "namespace from the message";
            fatalError(new XMLStreamingException(message, locator));
        }

        nestedElementLevel--;

        if (nestedElementLevel == 0) {
            // This must be the end of the current part.
            if (!currentPart.getName().equals(localName)) {
                // This should never happen because the document is supposed
                // to be valid before it reaches this process....But just in
                // case.
                XMLPipelineContext context = getPipelineContext();
                Locator locator = context.getCurrentLocator();
                String message = "Parts out of sync. Current part is " +
                        currentPart.getName() + " current endElement is " +
                        localName;
                fatalError(new XMLStreamingException(message, locator));
            }
View Full Code Here

            throws SAXException {

        // todo encode the characters
        if (nestedElementLevel == 0 && !isWhitespace(buffer, start, offset)) {
            XMLPipelineContext context = getPipelineContext();
            Locator locator = context.getCurrentLocator();
            String message = "No part seems to be associated with these " +
                    "characters since nestedElementLevel is 0";
            fatalError(new XMLStreamingException(message, locator));
        } else if (nestedElementLevel != 0) {
            partValueBuffer.append(buffer, start, offset);
View Full Code Here

TOP

Related Classes of org.xml.sax.Locator

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.