Package org.apache.xmlbeans

Examples of org.apache.xmlbeans.XmlObject.save()


*/
public class XmlBeansDataFormat implements DataFormat {

    public void marshal(Exchange exchange, Object body, OutputStream stream) throws Exception {
        XmlObject object = ExchangeHelper.convertToMandatoryType(exchange, XmlObject.class, body);
        object.save(stream);
    }

    public Object unmarshal(Exchange exchange, InputStream stream) throws Exception {
        return XmlObject.Factory.parse(stream);
    }
View Full Code Here


            // before saving, make sure the directory is present
            ensureMonitorDir();

            //TODO GERONIMO-3719.  Hack to use xmlbeans to write out xml instead of sun specific classes.
            XmlObject xmlObject = XmlObject.Factory.parse(document.getDocumentElement());
            xmlObject.save(new File(path));

            // formatting the doc
            // generate a file output
        } catch(Exception e) {
            log.error(e.getMessage(), e);
View Full Code Here

        XmlObject xmlObject = parse(source);
        xmlObject = upgrade(xmlObject);

        XmlOptions xmlOptions = new XmlOptions();
        xmlOptions.setSavePrettyPrint();
        xmlObject.save(target, xmlOptions);

    }

    public XmlObject upgrade(XmlObject xmlObject) throws XmlException {
        XmlCursor cursor = xmlObject.newCursor();
View Full Code Here

*/
public class XmlBeansDataFormat implements DataFormat {

    public void marshal(Exchange exchange, Object body, OutputStream stream) throws Exception {
        XmlObject object = ExchangeHelper.convertToMandatoryType(exchange, XmlObject.class, body);
        object.save(stream);
    }

    public Object unmarshal(Exchange exchange, InputStream stream) throws Exception {
        return XmlObject.Factory.parse(stream);
    }
View Full Code Here

                    targetDir.mkdirs();
                }

                XmlOptions xmlOptions = new XmlOptions();
                xmlOptions.setSavePrettyPrint();
                doc.save(targetFile, xmlOptions);

                if (getLog() != null) {
                    getLog().info("Generated: " + targetFile);
                }
            }
View Full Code Here

                continue;
            }
           
            try
            {
                doc.save(System.out, new XmlOptions().setSavePrettyPrint().setSavePrettyPrintIndent(indent));
            }
            catch (IOException e)
            {
                System.err.println("Unable to pretty print " + files[i] + ": " + e.getMessage());
            }
View Full Code Here

    public static String indent(String xmldoc)
        throws IOException, XmlException
    {
        StringWriter sw = new StringWriter();
        XmlObject doc = XmlObject.Factory.parse(xmldoc, (new XmlOptions()).setLoadLineNumbers());
        doc.save(sw, new XmlOptions().setSavePrettyPrint().setSavePrettyPrintIndent(DEFAULT_INDENT));
        sw.close();
        return sw.getBuffer().toString();
    }
}
View Full Code Here

*/
public class XmlBeansDataFormat implements DataFormat {

    public void marshal(Exchange exchange, Object body, OutputStream stream) throws Exception {
        XmlObject object = ExchangeHelper.convertToMandatoryType(exchange, XmlObject.class, body);
        object.save(stream);
    }

    public Object unmarshal(Exchange exchange, InputStream stream) throws Exception {
        return XmlObject.Factory.parse(stream);
    }
View Full Code Here

        XmlObject xmlObject = parse(source);
        xmlObject = upgrade(xmlObject);

        XmlOptions xmlOptions = new XmlOptions();
        xmlOptions.setSavePrettyPrint();
        xmlObject.save(target, xmlOptions);

    }

    public XmlObject upgrade(XmlObject xmlObject) throws XmlException {
        XmlCursor cursor = xmlObject.newCursor();
View Full Code Here

        XmlObject xmlObject = parse(source);
        xmlObject = upgrade(xmlObject);

        XmlOptions xmlOptions = new XmlOptions();
        xmlOptions.setSavePrettyPrint();
        xmlObject.save(target, xmlOptions);

    }

    public XmlObject upgrade(XmlObject xmlObject) throws XmlException {
        XmlCursor cursor = xmlObject.newCursor();
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.