Package org.jibx.runtime

Examples of org.jibx.runtime.IXMLWriter


            if (marshallerIndex < 0) {
                ((IMarshallable)dataObject).marshal(ctx);
            } else {
   
                // open namespaces from wrapper element
                IXMLWriter wrtr = ctx.getXmlWriter();
                wrtr.openNamespaces(openNamespaceIndexes, openNamespacePrefixes);
                String name = elementName;
                if (!"".equals(elementNamespacePrefix)) {
                    name = elementNamespacePrefix + ':' + name;
                }
                wrtr.startTagOpen(0, name);
   
                // marshal object representation (may include attributes) into element
                IMarshaller mrsh = ctx.getMarshaller(marshallerIndex,
                                                     bindingFactory
                                                             .getMappedClasses()[marshallerIndex]);
                mrsh.marshal(dataObject, ctx);
                wrtr.endTag(0, name);
            }
            ctx.getXmlWriter().flush();

        } catch (IOException e) {
            throw new JiBXException("Error marshalling XML representation", e);
View Full Code Here


    /* (non-Javadoc)
     * @see org.apache.axiom.om.OMDataSource#serialize(javax.xml.stream.XMLStreamWriter)
     */
    public void serialize(XMLStreamWriter xmlWriter) throws XMLStreamException {
        try {
            IXMLWriter writer = new StAXWriter(bindingFactory.getNamespaces(),
                                               xmlWriter);
            IMarshallingContext ctx = bindingFactory.createMarshallingContext();
            ctx.setXmlWriter(writer);
            marshal(ctx);
        } catch (JiBXException e) {
View Full Code Here

TOP

Related Classes of org.jibx.runtime.IXMLWriter

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.