Package javax.xml.stream

Examples of javax.xml.stream.XMLOutputFactory.createXMLStreamWriter()


   
    TextMD textmd = (TextMD)fitsOut.getStandardXmlContent();
    textmd.setRoot(true);
   
    XMLOutputFactory xmlof = XMLOutputFactory.newInstance();
    XMLStreamWriter writer = xmlof.createXMLStreamWriter(System.out);
   
    textmd.output(writer);
     
  }
View Full Code Here


      assertNotNull(output.getMetadataElement("md5checksum").getValue());
      */
      String errorText = output.getErrorMessages();
      XmlContent xml = output.getStandardXmlContent();
      if(xml != null) {
        XMLStreamWriter writer = xmlof.createXMLStreamWriter(System.out);
        xml.output(writer);
        writer.close();
      }
      System.out.println(errorText);
      System.out.println("valid = "+output.checkValid());
View Full Code Here

    XmlContent xml = fitsOut.getStandardXmlContent();
   
    if(xml != null) {
      xml.setRoot(true);
      XMLOutputFactory xmlof = XMLOutputFactory.newInstance();
      XMLStreamWriter writer = xmlof.createXMLStreamWriter(System.out);
     
      xml.output(writer);
    }
     
  }
View Full Code Here

   

    public static XMLStreamWriter createXMLStreamWriter(Writer out) {
        XMLOutputFactory factory = getXMLOutputFactory();
        try {
            return factory.createXMLStreamWriter(out);
        } catch (XMLStreamException e) {
            throw new RuntimeException("Cant' create XMLStreamWriter", e);
        } finally {
            returnXMLOutputFactory(factory);
        }
View Full Code Here

        if (encoding == null) {
            encoding = "UTF-8";
        }
        XMLOutputFactory factory = getXMLOutputFactory();
        try {
            return factory.createXMLStreamWriter(out, encoding);
        } catch (XMLStreamException e) {
            throw new RuntimeException("Cant' create XMLStreamWriter", e);
        } finally {
            returnXMLOutputFactory(factory);
        }
View Full Code Here

    }
   
    public static XMLStreamWriter createXMLStreamWriter(Result r) {
        XMLOutputFactory factory = getXMLOutputFactory();
        try {
            return factory.createXMLStreamWriter(r);
        } catch (XMLStreamException e) {
            throw new RuntimeException("Cant' create XMLStreamWriter", e);
        } finally {
            returnXMLOutputFactory(factory);
        }
View Full Code Here

            XMLOutputFactory factory = getXMLOutputFactory(message);
            if (factory == null) {
                writer = StaxUtils.createXMLStreamWriter(os, encoding);
            } else {
                synchronized (factory) {
                    writer = factory.createXMLStreamWriter(os, encoding);
                }
            }
            if (MessageUtils.getContextualBoolean(message, FORCE_START_DOCUMENT, false)) {
                writer.writeStartDocument(encoding, "1.0");
                message.removeContent(OutputStream.class);
View Full Code Here

    */
   protected synchronized void saveBindings() throws FileNotFoundException, XMLStreamException
   {
      XMLOutputFactory outputFactory = XMLOutputFactory.newInstance();
      XMLStreamWriter writer =
         outputFactory.createXMLStreamWriter(PrivilegedFileHelper.fileOutputStream(bindingsStorePath), "UTF-8");

      writer.writeStartDocument("UTF-8", "1.0");
      writer.writeStartElement(BIND_REFERENCES_ELEMENT);

      for (Entry<String, Reference> entry : bindings.entrySet())
View Full Code Here

    }

    private String marshall(SubsystemParser subsystemParser) throws Exception {
        StringWriter stringWriter = new StringWriter();
        XMLOutputFactory factory = XMLOutputFactory.newFactory();
        FormattingXMLStreamWriter writer = new FormattingXMLStreamWriter(factory.createXMLStreamWriter(stringWriter));
        try {
            Assert.assertNotNull(subsystemParser.getSubsystem());
            writer.writeStartDocument();
            subsystemParser.getSubsystem().marshall(writer);
            writer.writeEndDocument();
View Full Code Here

      pgTXs = new HashSet<>();

      queueBindings = new HashMap<>();

      XMLOutputFactory factory = XMLOutputFactory.newInstance();
         XMLStreamWriter rawXmlWriter = factory.createXMLStreamWriter(out, "UTF-8");
         PrettyPrintHandler handler = new PrettyPrintHandler(rawXmlWriter);
         xmlWriter = (XMLStreamWriter) Proxy.newProxyInstance(
               XMLStreamWriter.class.getClassLoader(),
               new Class[]{XMLStreamWriter.class},
               handler);
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.