Package com.sun.xml.fastinfoset.stax

Examples of com.sun.xml.fastinfoset.stax.StAXDocumentParser


    @Override
    protected final XMLStreamReader getXMLStreamReader(Class<?> elementType, MediaType mediaType, Unmarshaller u,
            InputStream entityStream)
            throws XMLStreamException {
        StAXDocumentParser parser = new StAXDocumentParser(entityStream);

        // jaxb needs interning doc parser, see http://java.net/jira/browse/JERSEY-320
        parser.setStringInterning(true);

        return parser;
    }
View Full Code Here


   
    @Override
    protected final Object readFrom(Class<Object> type, MediaType mediaType,
            Unmarshaller u, InputStream entityStream)
            throws JAXBException {
        final StAXDocumentParser p = new StAXDocumentParser(entityStream);
        if (type.isAnnotationPresent(XmlRootElement.class))
            return u.unmarshal(p);
        else
            return u.unmarshal(p, type).getValue();
    }
View Full Code Here

        return XMLStreamReader.class;
    }

    public XMLStreamReader transform(InputStream source, TransformationContext context) {
        try {
            StAXDocumentParser parser = new StAXDocumentParser(source);
            return parser;
        } catch (Exception e) {
            throw new TransformationException(e);
        }
    }
View Full Code Here

      MessageContext messageContext) throws AxisFault {
    if (logger.isDebugEnabled()) {
      logger.debug("Processing a Document with the content type: " + contentType);
    }
    //Create a instance of the StAX Parser which can handle the fast infoset stream
    XMLStreamReader streamReader = new StAXDocumentParser(inputStream);
    StAXBuilder builder = new StAXOMBuilder(streamReader);

    return builder.getDocumentElement();
  }
View Full Code Here

            streamWriter.writeStartDocument();
            element.serializeAndConsume(streamWriter);
            streamWriter.writeEndDocument();

            // now let's read the binary file in to Axiom
            XMLStreamReader streamReader = new StAXDocumentParser(new FileInputStream(tempFile));
            StAXBuilder builder = new StAXOMBuilder(streamReader);
            builder.getDocumentElement().serialize(new FileWriter(outputFile));

            // let's see this is the same that we fed in to this test initially
            assertXMLEqual(new FileReader(inputFile), new FileReader(outputFile));
View Full Code Here

      MessageContext messageContext) throws AxisFault {
    if (logger.isDebugEnabled()) {
      logger.debug("Processing a Document with the content type: " + contentType);
    }
    //Create a instance of the StAX Parser which can handle the fast infoset stream
    XMLStreamReader streamReader = new StAXDocumentParser(inputStream);
    StAXBuilder builder = new StAXSOAPModelBuilder(streamReader);

    return builder.getDocumentElement();
  }
View Full Code Here

            streamWriter.writeStartDocument();
            element.serializeAndConsume(streamWriter);
            streamWriter.writeEndDocument();

            // now let's read the binary file in to Axiom
            XMLStreamReader streamReader = new StAXDocumentParser(new FileInputStream(tempFile));
            StAXBuilder builder = new StAXOMBuilder(streamReader);
            builder.getDocumentElement().serialize(new FileWriter(outputFile));

            // let's see this is the same that we fed in to this test initially
            assertXMLEqual(new FileReader(inputFile), new FileReader(outputFile));
View Full Code Here

      MessageContext messageContext) throws AxisFault {
    if (logger.isDebugEnabled()) {
      logger.debug("Processing a Document with the content type: " + contentType);
    }
    //Create a instance of the StAX Parser which can handle the fast infoset stream
    XMLStreamReader streamReader = new StAXDocumentParser(inputStream);
    StAXBuilder builder = new StAXSOAPModelBuilder(streamReader);

    return builder.getDocumentElement();
  }
View Full Code Here

      MessageContext messageContext) throws AxisFault {
    if (logger.isDebugEnabled()) {
      logger.debug("Processing a Document with the content type: " + contentType);
    }
    //Create a instance of the StAX Parser which can handle the fast infoset stream
    XMLStreamReader streamReader = new StAXDocumentParser(inputStream);
    StAXBuilder builder = new StAXOMBuilder(streamReader);

    return builder.getDocumentElement();
  }
View Full Code Here

    public static FastInfosetStreamReaderFactory getInstance() {
        return factory;
    }
   
    public XMLStreamReader doCreate(String systemId, InputStream in, boolean rejectDTDs) {
        StAXDocumentParser parser = fetch();
        if (parser == null) {
            return FastInfosetCodec.createNewStreamReaderRecyclable(in, false);
        }
       
        parser.setInputStream(in);
        return parser;
    }
View Full Code Here

TOP

Related Classes of com.sun.xml.fastinfoset.stax.StAXDocumentParser

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.