Package javax.xml.stream

Examples of javax.xml.stream.XMLEventWriter


      @Override
      public void translate(Writer writer) throws TransformerException,
          IOException {
        try {
          XMLOutputFactory factory = getOutputFactory();
          XMLEventWriter eventWriter = factory.createXMLEventWriter(writer);
          XMLEventFactory eventFactory = XMLEventFactory.newInstance();
          for (Evaluator.NameValuePair nameValuePair : values) {
            if (nameValuePair.value == null) {
              continue;
            }
            addElement(nameValuePair.name, writer, eventWriter, eventFactory, namespaces, null, Collections.singletonList(nameValuePair.value));
          }
          eventWriter.close();
        } catch (XMLStreamException e) {
          throw new TransformerException(e);
        }
      }
    }));
View Full Code Here


      @Override
      public void translate(Writer writer) throws TransformerException,
          IOException {
        try {
          XMLOutputFactory factory = getOutputFactory();
          XMLEventWriter eventWriter = factory.createXMLEventWriter(writer);
          XMLEventFactory eventFactory = XMLEventFactory.newInstance();
          addElement(name, writer, eventWriter, eventFactory, namespaces, attributes, contents);
          eventWriter.close();
        } catch (XMLStreamException e) {
          throw new TransformerException(e);
        }
      }
View Full Code Here

        XMLInputFactory inputFactory = XMLInputFactory.newInstance();
        XMLOutputFactory outputFactory = XMLOutputFactory.newInstance();
        outputFactory.setProperty(XMLOutputFactory.IS_REPAIRING_NAMESPACES, Boolean.TRUE);

        ByteArrayOutputStream outStream = new ByteArrayOutputStream();
        XMLEventWriter evtWriter = outputFactory.createXMLEventWriter(outStream);
        writer.write(fault, faultPart, evtWriter);
        LOG.log(Level.INFO, "Found exception in the raises list.  Marshalling.");
        ByteArrayInputStream inStream = new ByteArrayInputStream(outStream.toByteArray());
        XMLEventReader evtReader = inputFactory.createXMLEventReader(inStream);
        CorbaObjectHandler obj = corbaStaxObject.readObjectFromStax(evtReader, exIdlType);
View Full Code Here

        if (writer != null) {
            OperationInfo opInfo = boi.getOperationInfo();
            List<Object> args = arguments;
            OperationType opType = boi.getExtensor(OperationType.class);
            ByteArrayOutputStream outStream = new ByteArrayOutputStream();
            XMLEventWriter evtWriter = outputFactory.createXMLEventWriter(outStream);
            for (int i = 0; i < args.size(); i++) {
                MessagePartInfo part = getInputMessagePartInfo(opInfo, i);    
                Object partValue = args.get(i);
                writer.write(partValue, part, evtWriter);
            }
View Full Code Here

        if (writer != null) {
            OperationInfo opInfo = boi.getOperationInfo();
            List<Object> args = arguments;

            ByteArrayOutputStream outStream = new ByteArrayOutputStream();
            XMLEventWriter evtWriter = outputFactory.createXMLEventWriter(outStream);
            for (int i = 0; i < args.size(); i++) {
                MessagePartInfo part = getOutputMessagePartInfo(opInfo, i);
                Object partValue = args.get(i);
                writer.write(partValue, part, evtWriter);
            }
View Full Code Here

                XMLInputFactory inputFactory = getXMLInputFactory();
                XMLOutputFactory outputFactory = getXMLOutputFactory();
               
                ByteArrayOutputStream outStream = new ByteArrayOutputStream();
                XMLEventWriter evtWriter = outputFactory.createXMLEventWriter(outStream);
                corbaStaxObject.writeObjectToStax(exStreamable.getObject(),
                                                  evtWriter,
                                                  XMLEventFactory.newInstance());
                evtWriter.flush();
                ByteArrayInputStream inStream = new ByteArrayInputStream(outStream.toByteArray());
                XMLEventReader evtReader = inputFactory.createXMLEventReader(inStream);
                FaultInfo fault = getFaultInfo(opInfo, elName);
                Object e = reader.read(fault.getMessageParts().get(0), evtReader);
                if (!(e instanceof Exception)) {
View Full Code Here

            XMLOutputFactory outputFactory = XMLOutputFactory.newInstance();
            outputFactory.setProperty(XMLOutputFactory.IS_REPAIRING_NAMESPACES,
                                      Boolean.TRUE);       

            ByteArrayOutputStream outStream = new ByteArrayOutputStream();
            XMLEventWriter evtWriter = outputFactory.createXMLEventWriter(outStream);
            CorbaStreamable retVal = outMessage.getStreamableReturn();
            corbaStaxObject.writeObjectToStax(retVal.getObject(), evtWriter,
                                              XMLEventFactory.newInstance());
            evtWriter.flush();
            ByteArrayInputStream inStream = new ByteArrayInputStream(outStream.toByteArray());
            XMLEventReader evtReader = inputFactory.createXMLEventReader(inStream);           
            MessagePartInfo part = getReturnMessagePartInfo(msgInfo);
            retValue = reader.read(part, evtReader);
            List<Object> args = new ArrayList<Object>();
View Full Code Here

            if (!skipRead) {
                XMLInputFactory inputFactory = getXMLInputFactory();
                XMLOutputFactory outputFactory = getXMLOutputFactory();
               
                ByteArrayOutputStream outStream = new ByteArrayOutputStream();
                XMLEventWriter evtWriter = outputFactory.createXMLEventWriter(outStream);
                corbaStaxObject.writeObjectToStax(streamables[i].getObject(),
                                                  evtWriter,
                                                  XMLEventFactory.newInstance());
                evtWriter.flush();
                ByteArrayInputStream inStream = new ByteArrayInputStream(outStream.toByteArray());
                XMLEventReader evtReader = inputFactory.createXMLEventReader(inStream);
                MessagePartInfo part = getMessagePartInfo(msgInfo,
                                                          index,
                                                          opType.getReturn() == null,
View Full Code Here

        XMLInputFactory inputFactory = XMLInputFactory.newInstance();
        XMLOutputFactory outputFactory = XMLOutputFactory.newInstance();
        outputFactory.setProperty(XMLOutputFactory.IS_REPAIRING_NAMESPACES, Boolean.TRUE);
     
        ByteArrayOutputStream outStream = new ByteArrayOutputStream();
        XMLEventWriter evtWriter = null;
        try {
            evtWriter = outputFactory.createXMLEventWriter(outStream);
        } catch (XMLStreamException ex) {
        }
        assertNotNull(evtWriter);
       
        try {
            XMLEventFactory factory = XMLEventFactory.newInstance();
            staxObject.writeObjectToStax(obj, evtWriter, factory);
            evtWriter.flush();
        } catch (XMLStreamException ex) {
           
        }

        ByteArrayInputStream inStream = new ByteArrayInputStream(outStream.toByteArray());       
View Full Code Here

        XMLInputFactory inputFactory = XMLInputFactory.newInstance();
        XMLOutputFactory outputFactory = XMLOutputFactory.newInstance();
        outputFactory.setProperty(XMLOutputFactory.IS_REPAIRING_NAMESPACES, Boolean.TRUE);
     
        ByteArrayOutputStream outStream = new ByteArrayOutputStream();
        XMLEventWriter evtWriter = null;
        try {
            evtWriter = outputFactory.createXMLEventWriter(outStream);
        } catch (XMLStreamException ex) {
        }
        assertNotNull(evtWriter);
       
        try {
            XMLEventFactory factory = XMLEventFactory.newInstance();
            staxObject.writeObjectToStax(obj, evtWriter, factory);
            evtWriter.flush();
        } catch (XMLStreamException ex) {
           
        }
        ByteArrayInputStream inStream = new ByteArrayInputStream(outStream.toByteArray());       
        XMLEventReader evtReader = null;
View Full Code Here

TOP

Related Classes of javax.xml.stream.XMLEventWriter

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.