Package org.codehaus.jettison

Examples of org.codehaus.jettison.AbstractXMLStreamWriter


            }
            Marshaller ms = createMarshaller(actualObject, actualClass, genericType, encoding);

            Configuration c = new Configuration(namespaceMap);
            MappedNamespaceConvention convention = new MappedNamespaceConvention(c);
            AbstractXMLStreamWriter xsw = new MappedXMLStreamWriter(
                                               convention,
                                               new OutputStreamWriter(os, encoding));
            if (serializeAsArray) {
                if (arrayKeys != null) {
                    for (String key : arrayKeys) {
                        xsw.seriliazeAsArray(key);
                    }
                } else {
                    String key = getKey(convention, cls);
                    xsw.seriliazeAsArray(key);
                }
            }
                       
            ms.marshal(actualObject, xsw);
            xsw.close();
           
        } catch (JAXBException e) {
            handleJAXBException(e);
        } catch (XMLStreamException e) {
            throw new WebApplicationException(e);
View Full Code Here


                                                     boolean serializeAsArray,
                                                     List<String> arrayKeys,
                                                     boolean dropRootElement) throws Exception {
       
        MappedNamespaceConvention convention = new MappedNamespaceConvention(config);
        AbstractXMLStreamWriter xsw = new MappedXMLStreamWriter(
                                            convention,
                                            new OutputStreamWriter(os, UTF8));
        if (serializeAsArray) {
            if (arrayKeys != null) {
                for (String key : arrayKeys) {
                    xsw.serializeAsArray(key);
                }
            } else if (qname != null) {
                String key = getKey(convention, qname);
                xsw.serializeAsArray(key);
            }
        }
        XMLStreamWriter writer = !writeXsiType || dropRootElement
            ? new IgnoreContentJettisonWriter(xsw, writeXsiType, dropRootElement) : xsw;
       
View Full Code Here

                                                     boolean serializeAsArray,
                                                     List<String> arrayKeys,
                                                     boolean dropRootElement) throws Exception {
       
        MappedNamespaceConvention convention = new PrefixRespectingMappedNamespaceConvention(config);
        AbstractXMLStreamWriter xsw = new MappedXMLStreamWriter(
                                            convention,
                                            new OutputStreamWriter(os, UTF8));
        if (serializeAsArray) {
            if (arrayKeys != null) {
                for (String key : arrayKeys) {
                    xsw.serializeAsArray(key);
                }
            } else {
                String key = getKey(convention, qname);
                xsw.serializeAsArray(key);
            }
        }
        XMLStreamWriter writer = !writeXsiType || dropRootElement
            ? new IgnoreContentJettisonWriter(xsw, writeXsiType,
                                              dropRootElement ? qname : null) : xsw;
View Full Code Here

                                                     boolean serializeAsArray,
                                                     List<String> arrayKeys,
                                                     boolean dropRootElement) throws Exception {
       
        MappedNamespaceConvention convention = new MappedNamespaceConvention(config);
        AbstractXMLStreamWriter xsw = new MappedXMLStreamWriter(
                                            convention,
                                            new OutputStreamWriter(os, UTF8));
        if (serializeAsArray) {
            if (arrayKeys != null) {
                for (String key : arrayKeys) {
                    xsw.serializeAsArray(key);
                }
            } else if (qname != null) {
                String key = getKey(convention, qname);
                xsw.serializeAsArray(key);
            }
        }
        XMLStreamWriter writer = !writeXsiType || dropRootElement
            ? new IgnoreContentJettisonWriter(xsw, writeXsiType, dropRootElement) : xsw;
       
View Full Code Here

                                                     boolean serializeAsArray,
                                                     List<String> arrayKeys,
                                                     boolean dropRootElement) throws Exception {
       
        MappedNamespaceConvention convention = new PrefixRespectingMappedNamespaceConvention(config);
        AbstractXMLStreamWriter xsw = new MappedXMLStreamWriter(
                                            convention,
                                            new OutputStreamWriter(os, UTF8));
        if (serializeAsArray) {
            if (arrayKeys != null) {
                for (String key : arrayKeys) {
                    xsw.serializeAsArray(key);
                }
            } else {
                String key = getKey(convention, qname);
                xsw.serializeAsArray(key);
            }
        }
        XMLStreamWriter writer = !writeXsiType || dropRootElement
            ? new IgnoreContentJettisonWriter(xsw, writeXsiType,
                                              dropRootElement ? qname : null) : xsw;
View Full Code Here

                                                     boolean serializeAsArray,
                                                     List<String> arrayKeys,
                                                     boolean dropRootElement) throws Exception {
       
        MappedNamespaceConvention convention = new MappedNamespaceConvention(config);
        AbstractXMLStreamWriter xsw = new MappedXMLStreamWriter(
                                            convention,
                                            new OutputStreamWriter(os, UTF8));
        if (serializeAsArray) {
            if (arrayKeys != null) {
                for (String key : arrayKeys) {
                    xsw.serializeAsArray(key);
                }
            } else {
                String key = getKey(convention, qname);
                xsw.serializeAsArray(key);
            }
        }
        XMLStreamWriter writer = !writeXsiType || dropRootElement
            ? new IgnoreContentJettisonWriter(xsw, writeXsiType,
                                              dropRootElement ? qname : null) : xsw;
View Full Code Here

                                                     boolean serializeAsArray,
                                                     List<String> arrayKeys,
                                                     boolean dropRootElement) throws Exception {
       
        MappedNamespaceConvention convention = new MappedNamespaceConvention(config);
        AbstractXMLStreamWriter xsw = new MappedXMLStreamWriter(
                                            convention,
                                            new OutputStreamWriter(os, UTF8));
        if (serializeAsArray) {
            if (arrayKeys != null) {
                for (String key : arrayKeys) {
                    xsw.serializeAsArray(key);
                }
            } else if (qname != null) {
                String key = getKey(convention, qname);
                xsw.serializeAsArray(key);
            }
        }
        XMLStreamWriter writer = !writeXsiType || dropRootElement
            ? new IgnoreContentJettisonWriter(xsw, writeXsiType, dropRootElement) : xsw;
       
View Full Code Here

                                                     boolean serializeAsArray,
                                                     List<String> arrayKeys,
                                                     boolean dropRootElement) throws Exception {
       
        MappedNamespaceConvention convention = new MappedNamespaceConvention(config);
        AbstractXMLStreamWriter xsw = new MappedXMLStreamWriter(
                                            convention,
                                            new OutputStreamWriter(os, UTF8));
        if (serializeAsArray) {
            if (arrayKeys != null) {
                for (String key : arrayKeys) {
                    xsw.serializeAsArray(key);
                }
            } else if (qname != null) {
                String key = getKey(convention, qname);
                xsw.serializeAsArray(key);
            }
        }
        XMLStreamWriter writer = !writeXsiType || dropRootElement
            ? new IgnoreContentJettisonWriter(xsw, writeXsiType, dropRootElement) : xsw;
       
View Full Code Here

            }
            Marshaller ms = createMarshaller(actualObject, actualClass, genericType, m);

            Configuration c = new Configuration(namespaceMap);
            MappedNamespaceConvention convention = new MappedNamespaceConvention(c);
            AbstractXMLStreamWriter xsw = new MappedXMLStreamWriter(
                                               convention,
                                               new OutputStreamWriter(os, "UTF-8"));
            if (serializeAsArray) {
                if (arrayKeys != null) {
                    for (String key : arrayKeys) {
                        xsw.seriliazeAsArray(key);
                    }
                } else {
                    String key = getKey(convention, cls);
                    xsw.seriliazeAsArray(key);
                }
            }
                       
            ms.marshal(actualObject, xsw);
            xsw.close();
           
        } catch (JAXBException e) {
            handleJAXBException(e);
        } catch (XMLStreamException e) {
            throw new WebApplicationException(e);
View Full Code Here

                                                     boolean serializeAsArray,
                                                     List<String> arrayKeys,
                                                     boolean dropRootElement) throws Exception {
       
        MappedNamespaceConvention convention = new MappedNamespaceConvention(config);
        AbstractXMLStreamWriter xsw = new MappedXMLStreamWriter(
                                            convention,
                                            new OutputStreamWriter(os, UTF8));
        if (serializeAsArray) {
            if (arrayKeys != null) {
                for (String key : arrayKeys) {
                    xsw.serializeAsArray(key);
                }
            } else {
                String key = getKey(convention, qname);
                xsw.serializeAsArray(key);
            }
        }
        XMLStreamWriter writer = !writeXsiType || dropRootElement
            ? new IgnoreContentJettisonWriter(xsw, writeXsiType,
                                              dropRootElement ? qname : null) : xsw;
View Full Code Here

TOP

Related Classes of org.codehaus.jettison.AbstractXMLStreamWriter

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.