Package javanet.staxutils

Examples of javanet.staxutils.StaxUtilsXMLOutputFactory


   * @param review The JAXB review object representing the data to write to file.
   * @throws IOException Thrown if there are issues writing to file.
   * @throws XMLStreamException Thrown if there are errors writing to the XML stream.
   */
  private static void write(File outputXml, Review review) throws IOException, XMLStreamException {
    StaxUtilsXMLOutputFactory xmlof = new StaxUtilsXMLOutputFactory(XMLOutputFactory.newInstance());
    xmlof.setProperty(StaxUtilsXMLOutputFactory.INDENTING, true);
    XMLStreamWriter writer = null;
    try {
      writer = xmlof.createXMLStreamWriter(new FileOutputStream(outputXml), "UTF-8");
      writer.writeStartDocument("UTF-8", "1.0");

      StaxReviewXmlUtil.writeReview(writer, review);
    }
    finally {
View Full Code Here


    ReviewPlugin plugin = ReviewPlugin.getInstance();
    File stateLocationXmlFile = plugin.getStateLocation().append(PREFERENCE_XML_FILE).toFile();
   
    XMLStreamWriter writer = null;
    try {
      StaxUtilsXMLOutputFactory xmlof = new StaxUtilsXMLOutputFactory(XMLOutputFactory
          .newInstance());
      xmlof.setProperty(StaxUtilsXMLOutputFactory.INDENTING, true);

      writer = xmlof.createXMLStreamWriter(new FileOutputStream(stateLocationXmlFile), "UTF-8");
      writer.writeStartDocument("UTF-8", "1.0");
     
      StaxPreferenceXmlUtil.writePreference(writer, preference);
     
      writer.writeEndDocument();
View Full Code Here

      log.error(e);
    }
   
    File outputPropertyFile = outputPropertyIFile.getLocation().toFile();

    StaxUtilsXMLOutputFactory xmlof = new StaxUtilsXMLOutputFactory(XMLOutputFactory
        .newInstance());
    xmlof.setProperty(StaxUtilsXMLOutputFactory.INDENTING, true);
    XMLStreamWriter writer = null;
    try {
      writer = xmlof.createXMLStreamWriter(new FileOutputStream(outputPropertyFile), "UTF-8");
      writer.writeStartDocument("UTF-8", "1.0");

      writer.writeStartElement(PropertyConstraints.ELEMENT_PROPERTY);

      List<Review> reviews = property.getReview();
View Full Code Here

TOP

Related Classes of javanet.staxutils.StaxUtilsXMLOutputFactory

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.