Package javax.xml.transform.stax

Examples of javax.xml.transform.stax.StAXSource


     * @throws XMLStreamException
     */
    @Converter
    public StAXSource toStAXSource(byte[] in, Exchange exchange) throws XMLStreamException {
        XMLStreamReader r = new StaxConverter().createXMLStreamReader(new ByteArrayInputStream(in), exchange);
        return new StAXSource(r);
    }
View Full Code Here


     * @throws XMLStreamException
     */
    @Converter
    public StAXSource toStAXSource(InputStream source, Exchange exchange) throws XMLStreamException {
        XMLStreamReader r = new StaxConverter().createXMLStreamReader(source, exchange);
        return new StAXSource(r);
    }
View Full Code Here

     */
    @Converter
    public StAXSource toStAXSource(File file, Exchange exchange) throws FileNotFoundException, XMLStreamException {
        InputStream is = IOHelper.buffered(new FileInputStream(file));
        XMLStreamReader r = new StaxConverter().createXMLStreamReader(is, exchange);
        return new StAXSource(r);
    }
View Full Code Here

                return ((Element)nd).getLocalName();
            } else if (source instanceof StaxSource) {
                StaxSource s = (StaxSource)source;
                r = s.getXMLStreamReader();
            } else if (source instanceof StAXSource) {
                StAXSource s = (StAXSource)source;
                r = s.getXMLStreamReader();
            } else if (source instanceof StreamSource || source instanceof SAXSource) {
                //flip to stax so we can get the name
                r = StaxUtils.createXMLStreamReader(source);
                StaxSource src2 = new StaxSource(r);
                sources.set(i, src2);
View Full Code Here

     */
    @SuppressWarnings("unchecked")
    protected <T extends Source>T createStAXSource(
            Class<T> sourceClass) throws SQLException {

        StAXSource      source      = null;
        Constructor     sourceCtor  = null;
        Reader          reader      = null;
        XMLInputFactory factory     = null;
        XMLEventReader  eventReader = null;

View Full Code Here

              .getCharacterStream(this.columnIndexOfXml);
        } else {
          reader = new StringReader(this.stringRep);
        }

        return new StAXSource(this.inputFactory
            .createXMLStreamReader(reader));
      } catch (XMLStreamException ex) {
        SQLException sqlEx = SQLError.createSQLException(ex
            .getMessage(), SQLError.SQL_STATE_ILLEGAL_ARGUMENT, this.exceptionInterceptor);
        sqlEx.initCause(ex);
View Full Code Here

                return ((Element)((DOMSource)source).getNode()).getLocalName();
            } else if (source instanceof StaxSource) {
                StaxSource s = (StaxSource)source;
                return s.getXMLStreamReader().getLocalName();
            } else if (source instanceof StAXSource) {
                StAXSource s = (StAXSource)source;
                XMLStreamReader r = s.getXMLStreamReader();
                if (r.getEventType() != XMLStreamReader.START_ELEMENT) {
                    try {
                        r.nextTag();
                    } catch (XMLStreamException e) {
                        //ignore
View Full Code Here

     * @throws XMLStreamException
     */
    @Converter
    public StAXSource toStAXSource(String source, Exchange exchange) throws XMLStreamException {
        XMLStreamReader r = new StaxConverter().createXMLStreamReader(new StringReader(source));
        return new StAXSource(r);
    }   
View Full Code Here

     * @throws XMLStreamException
     */
    @Converter
    public StAXSource toStAXSource(byte[] in, Exchange exchange) throws XMLStreamException {
        XMLStreamReader r = new StaxConverter().createXMLStreamReader(new ByteArrayInputStream(in), exchange);
        return new StAXSource(r);
    }
View Full Code Here

     * @throws XMLStreamException
     */
    @Converter
    public StAXSource toStAXSource(InputStream source, Exchange exchange) throws XMLStreamException {
        XMLStreamReader r = new StaxConverter().createXMLStreamReader(source, exchange);
        return new StAXSource(r);
    }
View Full Code Here

TOP

Related Classes of javax.xml.transform.stax.StAXSource

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.