Package com.volantis.xml.pipeline.sax

Examples of com.volantis.xml.pipeline.sax.XMLStreamingException


        // 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));
        }

        if (nestedElementLevel == 0) {
            // This must be the start of a part.();
            currentPart = new Part();
View Full Code Here


        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));
            }

            currentPart.setValue(partValueBuffer.toString());
            message.addPart(currentPart);
            partValueBuffer = null;
View Full Code Here

        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

            setContentHandler(templatesHandler);
            templatesHandler.startDocument();
        } catch (TransformerConfigurationException e) {
            Locator locator = getPipelineContext().getCurrentLocator();
            String message = "Unable to load TemplatesHandler";
            fatalError(new XMLStreamingException(message, locator, e));
        }
    }
View Full Code Here

                                getTransformer().setParameter(name, value);
                    }
                } catch (TransformerConfigurationException e) {
                    Locator locator = getPipelineContext().getCurrentLocator();
                    String message = "Unable to create new TransformHandler";
                    fatalError(new XMLStreamingException(message, locator, e));
                }

                transformerHandler.setResult(new SAXResult(handler));
                handler = transformerHandler;
            }
View Full Code Here

                                index,
                                convert.toURLC(getPipelineContext(),
                                               newAttrs.getValue(index),
                                               serverURL));
                    } catch (URLConversionException e) {
                        fatalError(new XMLStreamingException(
                                "URL to URLC conversion failure",
                                getPipelineContext().getCurrentLocator(),
                                e));
                    }

                    // If the attribute is to be renamed, rename it
                    if (replaceAttr != null) {
                        replaceIndex = newAttrs.getIndex(replaceAttr);

                        if ((replaceIndex != -1) && (replaceIndex != index)) {
                            fatalError(new XMLStreamingException(
                                    "URL to URLC conversion failure: attempt to " +
                                    "rename attribute " +
                                    attr + " to attribute " +
                                    replaceAttr + " failed because " +
                                    replaceAttr + " already exists",
View Full Code Here

            Locator currentLocator =
                    context.getCurrentLocator();

            // this is a streaming error as the part of the document might
            // have been included.
            XMLStreamingException se =
                    new XMLStreamingException("Could not include text document " +
                                              url.toExternalForm(),
                                              currentLocator, ioe);

            uridFetchTransaction.stop(
                MonitoredTransaction.FAILED, url.toExternalForm());
View Full Code Here

     * @param type the SAX event type for which the error is to be reported
     * @throws SAXException if the error handler can't handle the exception or
     *                      there is no error handler
     */
    protected void reportFatalError(String type) throws SAXException {
        XMLStreamingException e = new XMLStreamingException(
                "Unexpected " + type + " event received (not permitted)",
                context.getCurrentLocator());

        fatalError(e);
    }
View Full Code Here

     * @param type the SAX event type for which the error is to be reported
     * @throws SAXException if the error handler can't handle the exception or
     *                      there is no error handler
     */
    protected void reportError(String type) throws SAXException {
        XMLStreamingException e = new XMLStreamingException(
                "Unexpected " + type + " event received (not anticipated)",
                context.getCurrentLocator());

        error(e);
    }
View Full Code Here

     * @param type the SAX event type for which the warning is to be reported
     * @throws SAXException if the error handler can't handle the exception or
     *                      there is no error handler
     */
    protected void reportWarning(String type) throws SAXException {
        XMLStreamingException e = new XMLStreamingException(
                "Unexpected " + type + " event received (not anticipated)",
                context.getCurrentLocator());

        warning(e);
    }
View Full Code Here

TOP

Related Classes of com.volantis.xml.pipeline.sax.XMLStreamingException

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.