Package javax.xml.stream

Examples of javax.xml.stream.XMLInputFactory.createXMLEventReader()


        }

        ByteArrayInputStream inStream = new ByteArrayInputStream(outStream.toByteArray());       
        XMLEventReader evtReader = null;
        try {           
            evtReader = inputFactory.createXMLEventReader(inStream);
            // read the first tag which should be a start document
            XMLEvent evt = evtReader.nextEvent();
            assertTrue(evt.isStartDocument());
        } catch (XMLStreamException ex) {
        }
View Full Code Here


        }

        ByteArrayInputStream inStream = new ByteArrayInputStream(outStream.toByteArray());       
        XMLEventReader evtReader = null;
        try {           
            evtReader = inputFactory.createXMLEventReader(inStream);
            // read the first tag which should be a start document
            XMLEvent evt = evtReader.nextEvent();
            assertTrue(evt.isStartDocument());
        } catch (XMLStreamException ex) {
        }
View Full Code Here

  XmlHandler(byte[] content, Set<? extends Iterable<String>> paths)
      throws XMLStreamException {
    prefixTrie = new PathTrie(paths);
    Reader reader = new InputStreamReader(new ByteArrayInputStream(content), UTF_8);
    XMLInputFactory f = XMLInputFactory.newInstance();
    xmlr = f.createXMLEventReader(reader);
  }

  public boolean hasNext() throws XMLStreamException {
    if (next == null) {
      next = next();
View Full Code Here

    try {

      XMLInputFactory inputFactory = XMLInputFactory.newInstance();
      InputStream in = new FileInputStream(configFile);
      XMLEventReader eventReader = inputFactory.createXMLEventReader(in);
     
      Map<String, String> newConfig = new HashMap<String, String>();

      while (eventReader.hasNext()) {
View Full Code Here

    try {
      // First create a new XMLInputFactory
      XMLInputFactory inputFactory = XMLInputFactory.newInstance();
      // Setup a new eventReader
      InputStream in = new FileInputStream(configFile);
      XMLEventReader eventReader = inputFactory.createXMLEventReader(in);
      // Read the XML document
      Item item = null;
     
      while (eventReader.hasNext()) {
        XMLEvent event = eventReader.nextEvent();
View Full Code Here

                writeObjectToStax(corbaCtx.getMessage().getStreamableReturn().getObject(),
                                  evtWriter, XMLEventFactory.newInstance(), false);
                evtWriter.flush();

                ByteArrayInputStream inStream = new ByteArrayInputStream(outStream.toByteArray());
                XMLEventReader evtReader = inputFactory.createXMLEventReader(inStream);
                Object returnValue = reader.read(callback.getWebResultQName(), -1, evtReader);

                objContext.setReturn(returnValue);
            }
        } catch (java.lang.Exception ex) {
View Full Code Here

                ByteArrayOutputStream outStream = new ByteArrayOutputStream();
                XMLEventWriter evtWriter = outputFactory.createXMLEventWriter(outStream);
                writer.write(objContext.getReturn(), callback.getWebResultQName(), evtWriter);

                ByteArrayInputStream inStream = new ByteArrayInputStream(outStream.toByteArray());
                XMLEventReader evtReader = inputFactory.createXMLEventReader(inStream);
                CorbaObjectHandler obj = readObjectFromStax(evtReader,
                                                            opElement.getReturn().getIdltype(),
                                                            false);
                CorbaStreamable streamable = new CorbaStreamable(obj, callback.getWebResultQName());
                corbaCtx.getMessage().setStreamableReturn(streamable);
View Full Code Here

                        "Could not find the exception in the raises list.  Must be a system exception.");
                // This could be a system exception?
            } else {
                LOG.log(Level.INFO, "Found exception in the raises list.  Marshalling.");
                ByteArrayInputStream inStream = new ByteArrayInputStream(outStream.toByteArray());
                XMLEventReader evtReader = inputFactory.createXMLEventReader(inStream);
                CorbaObjectHandler obj = readObjectFromStax(evtReader, exIdlType, false);
                CorbaStreamable streamable = new CorbaStreamable(obj, elName);
                corbaCtx.getMessage().setStreamableException(streamable);
            }
           
View Full Code Here

            // zuerst eine neue XMLInputFactory erstellen
            XMLInputFactory inputFactory = XMLInputFactory.newInstance();

            // einen neuen eventReader einrichten
            InputStream in = new FileInputStream(f);
            XMLEventReader eventReader = inputFactory.createXMLEventReader(in);

            // Objekte erzeugen
            ReceiverListModel pReceiverList = null;
            ReceiverModel pReceiver = null;
            ApplicationModel pApplication = null;
View Full Code Here

                public void report(String message, String errorType, Object relatedInformation, Location location) throws XMLStreamException {
                    LOG.warn(message + " errorType: " + errorType + " relatedInfo: " + relatedInformation);
                }
            });

            xmlReader = xif.createXMLEventReader(inputStream);

            XMLEvent docStart = xmlReader.nextEvent();

            XMLEvent rootElement = xmlReader.nextTag();
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.