Package javax.xml.stream

Examples of javax.xml.stream.XMLStreamException


        try {
            writeEndDocument();
            outputProcessorChain.reset();
            outputProcessorChain.doFinal();
        } catch (XMLSecurityException e) {
            throw new XMLStreamException(e);
        }
    }
View Full Code Here


    }

    @Override
    public void writeAttribute(String localName, String value) throws XMLStreamException {
        if (openStartElement == null) {
            throw new XMLStreamException("No open start element.");
        }
        openStartElement.addAttribute(
                XMLSecEventFactory.createXMLSecAttribute(
                        new QName(localName), value));
    }
View Full Code Here

    @Override
    public void writeAttribute(String prefix, String namespaceURI, String localName, String value)
            throws XMLStreamException {
        if (openStartElement == null) {
            throw new XMLStreamException("No open start element.");
        }
        openStartElement.addAttribute(
                XMLSecEventFactory.createXMLSecAttribute(
                        new QName(namespaceURI, localName, prefix), value));
    }
View Full Code Here

    }

    @Override
    public void writeAttribute(String namespaceURI, String localName, String value) throws XMLStreamException {
        if (openStartElement == null) {
            throw new XMLStreamException("No open start element.");
        }
        openStartElement.addAttribute(
                XMLSecEventFactory.createXMLSecAttribute(
                        new QName(namespaceURI, localName, getNamespaceContext().getPrefix(namespaceURI)), value));
    }
View Full Code Here

    }

    @Override
    public void writeNamespace(String prefix, String namespaceURI) throws XMLStreamException {
        if (openStartElement == null) {
            throw new XMLStreamException("No open start element.");
        }
        this.openStartElement.addNamespace(XMLSecEventFactory.createXMLSecNamespace(prefix, namespaceURI));
    }
View Full Code Here

    }

    @Override
    public void writeDefaultNamespace(String namespaceURI) throws XMLStreamException {
        if (openStartElement == null) {
            throw new XMLStreamException("No open start element.");
        }
        //workaround for sun's stax parser:
        if (this.openStartElement.getElementPrefix().equals(XMLConstants.DEFAULT_NS_PREFIX)) {
            this.openStartElement.setElementNamespace(namespaceURI);
            this.openStartElement.setElementPrefix(XMLConstants.DEFAULT_NS_PREFIX);
View Full Code Here

    }

    @Override
    public void writeDTD(String dtd) throws XMLStreamException {
        if (elementStack != null) {
            throw new XMLStreamException("Not in prolog");
        }
        chainProcessEvent(XMLSecEventFactory.createXMLSecDTD(dtd));
    }
View Full Code Here

                }
            }
            try {
                schema.newValidator().validate(new DOMSource(newElement));
            } catch (SAXException e) {
                throw new XMLStreamException(e.getMessage(), e);
            }
        }
        return rootElement;       
    }
View Full Code Here

        setProperty(factory, XMLInputFactory.IS_SUPPORTING_EXTERNAL_ENTITIES, Boolean.FALSE);
        factory.setXMLResolver(new XMLResolver() {
            public Object resolveEntity(String publicID, String systemID,
                                        String baseURI, String namespace)
                throws XMLStreamException {
                throw new XMLStreamException("Reading external entities is disabled");
            }
        });
       
        return factory;
    }
View Full Code Here

                            //ignore
                        }
                        reader.parse(((SAXSource)source).getInputSource());
                        return;
                    } catch (Exception e) {
                        throw new XMLStreamException(e.getMessage(), e);
                    }
                } else if (ss.getInputSource() == null) {
                    //nothing to copy, just return
                    return;
                }
View Full Code Here

TOP

Related Classes of javax.xml.stream.XMLStreamException

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.