Package com.volantis.xml.sax

Examples of com.volantis.xml.sax.ExtendedSAXParseException


                    skipElementBody();
                    return;

                default :
                    // An unknown return code was received from the PAPIElement.
                    throw new ExtendedSAXParseException("Unknown return code of " +
                            result + " from " + element + " startElement",
                            marlinContext.getLocator());
            }
        } catch (IAPIException e) {
            // Wrap the exception in a SAXException.
            throw new ExtendedSAXParseException(null, marlinContext.getLocator(), e);
        }
    }
View Full Code Here


                    }
                    return;

                default :
                    // An unknown return code was received from the IAPIElement.
                    throw new ExtendedSAXParseException("Unknown return code of "
                            + result + " from " + element + " endElement",
                            marlinContext.getLocator());
            }
        } catch (IAPIException e) {
            // Wrap the exception in a SAXException.
            throw new ExtendedSAXParseException(null, marlinContext.getLocator(), e);
        }
    }
View Full Code Here

            if (SAXUtils.isWhitespaceCharacters(characters, start, length)) {
                return;
            }

            throw new ExtendedSAXParseException("Unexpected characters '" +
                    new String(characters, start, length) + "'",
                    marlinContext.getLocator());

        }

        // Get the current request context
        MarinerRequestContext requestContext = context.getRequestContext();

        PAPIElement element = elementStackEntry.element;
        PAPIAttributes attributes = elementStackEntry.attributes;

        try {
            // Get the content writer for the element.
            Writer writer = element.getContentWriter(requestContext, attributes);

            // Write the content out to the body of the element.
            writer.write(characters, start, length);
        } catch (PAPIException e) {
            throw new ExtendedSAXParseException(null, marlinContext.getLocator(), e);
        } catch (IOException e) {
            throw new ExtendedSAXParseException(null, marlinContext.getLocator(), e);
        }
    }
View Full Code Here

            // Get the MarlinElementHandler for the element identified by the
            // localName, if no suitable one exists then it is an error.
            MarlinElementHandler handler = getMarlinElementHandler(localName);
            if (handler == null) {
                throw new ExtendedSAXParseException("Unknown element '" + localName + "'",
                    marlinContext.getLocator());
            }

            pushElementOnStack(handler, saxAttributes);
            callPAPIElementStart();
View Full Code Here

                    skipElementBody();
                    return;

                default :
                    // An unknown return code was received from the PAPIElement.
                    throw new ExtendedSAXParseException("Unknown return code of " +
                            result + " from " + element + " startElement",
                            marlinContext.getLocator());
            }
        } catch (PAPIException e) {
            // Wrap the exception in a SAXException.
            throw new ExtendedSAXParseException(null, marlinContext.getLocator(), e);
        }
    }
View Full Code Here

            // Sanity check: Make sure that the element matches the one that we
            // popped off the stack.
            MarlinElementHandler check = getMarlinElementHandler(localName);
            if (check != handler) {
                throw new ExtendedSAXParseException("Element " + localName +
                        " does not match popped " + handler,
                        marlinContext.getLocator());
            }

            callPAPIElementEnd(handler);
View Full Code Here

                    skipElementBody();
                } else if (!XDIMEResult.PROCESS_ELEMENT_BODY.equals(result)) {
                    // An invalid return code was received from the
                    // XDIMEElement as the only other acceptable option is
                    // to CONTINUE_PROCESSING
                    throw new ExtendedSAXParseException(
                            EXCEPTION_LOCALIZER.format("xdime-result-invalid",
                            new Object[]{result, "elementStart",
                                         element}),
                            xdimeContext.getDocumentLocator());
                }
View Full Code Here

                    xdimeContext.setAbort(true);
                } else if (!XDIMEResult.CONTINUE_PROCESSING.equals(result)) {
                    // An invalid return code was received from the
                    // XDIMEElement as the only other acceptible option is
                    // to CONTINUE_PROCESSING
                    throw new ExtendedSAXParseException(
                            EXCEPTION_LOCALIZER.format("xdime-result-invalid",
                            new Object[]{result, "elementEnd",
                                         element}),
                            xdimeContext.getDocumentLocator());
                }
View Full Code Here

                FastWriter writer = xdimeContext.getContentWriter();

                // Write the content out to the body of the element.
                writer.write(characters, start, length);
            } catch (IOException e) {
                throw new ExtendedSAXParseException(null,
                        xdimeContext.getDocumentLocator(), e);
            }
        }
    }
View Full Code Here

             * @param e original exception
             * @return the adjusted exception.
             */
            private SAXParseException adjust(SAXParseException e) {
                int colNo = e.getColumnNumber() - ROOT_ELEMENT.length() - 2;
                return new ExtendedSAXParseException(e.getLocalizedMessage(), null, null,
                        e.getLineNumber(), colNo);
            }
        });

        // Find the XML we need to parse. Note that we wrap the task in an
View Full Code Here

TOP

Related Classes of com.volantis.xml.sax.ExtendedSAXParseException

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.