Examples of AbstractXMLStreamWriter


Examples of org.codehaus.jettison.AbstractXMLStreamWriter

    protected XMLStreamWriter createWriter(Object actualObject, Class<?> actualClass,
        Type genericType, String enc, OutputStream os, boolean isCollection) throws Exception {
        QName qname = getQName(actualClass, genericType, actualObject, true);
        Configuration c = new Configuration(namespaceMap);
        MappedNamespaceConvention convention = new MappedNamespaceConvention(c);
        AbstractXMLStreamWriter xsw = new MappedXMLStreamWriter(
                                            convention,
                                            new OutputStreamWriter(os, enc));
        if (serializeAsArray) {
            if (arrayKeys != null) {
                for (String key : arrayKeys) {
                    xsw.seriliazeAsArray(key);
                }
            } else {
                String key = getKey(convention, qname);
                xsw.seriliazeAsArray(key);
            }
        }

        return isCollection || dropRootElement ? new JSONCollectionWriter(xsw, qname) : xsw;
    }
View Full Code Here

Examples of org.codehaus.jettison.AbstractXMLStreamWriter

        if (writeXsiType) {
            namespaceMap.putIfAbsent("http://www.w3.org/2001/XMLSchema-instance", "xsins");
        }
        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, qname);
                xsw.seriliazeAsArray(key);
            }
        }
        return xsw;
    }
View Full Code Here

Examples of org.codehaus.jettison.AbstractXMLStreamWriter

            }
            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) {
            throw new WebApplicationException(e);
        } catch (XMLStreamException e) {
            throw new WebApplicationException(e);
View Full Code Here

Examples of org.codehaus.jettison.AbstractXMLStreamWriter

                                                     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

Examples of org.codehaus.jettison.AbstractXMLStreamWriter

            }
            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

Examples of org.codehaus.jettison.AbstractXMLStreamWriter

                                                     List<String> arrayKeys,
                                                     boolean dropRootElement,
                                                     String enc) throws Exception {
    //CHECKSTYLE:ON   
        MappedNamespaceConvention convention = new MappedNamespaceConvention(config);
        AbstractXMLStreamWriter xsw = new MappedXMLStreamWriter(
                                            convention,
                                            new OutputStreamWriter(os, enc));
        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

Examples of org.codehaus.jettison.AbstractXMLStreamWriter

                                                     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

Examples of org.codehaus.jettison.AbstractXMLStreamWriter

                                                     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

Examples of org.codehaus.jettison.AbstractXMLStreamWriter

                                                     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

Examples of org.codehaus.jettison.AbstractXMLStreamWriter

        if (writeXsiType) {
            namespaceMap.putIfAbsent(XSI_URI, XSI_PREFIX);
        }
        Configuration c = new Configuration(namespaceMap);
        MappedNamespaceConvention convention = new MappedNamespaceConvention(c);
        AbstractXMLStreamWriter xsw = new MappedXMLStreamWriter(
                                            convention,
                                            new OutputStreamWriter(os, UTF8));
        if (serializeAsArray) {
            if (arrayKeys != null) {
                for (String key : arrayKeys) {
                    xsw.seriliazeAsArray(key);
                }
            } else {
                String key = getKey(convention, qname);
                xsw.seriliazeAsArray(key);
            }
        }
        XMLStreamWriter writer = !writeXsiType || dropRootElement
            ? new IgnoreContentJettisonWriter(xsw, writeXsiType,
                                              dropRootElement ? qname : null) : xsw;
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.