Package org.codehaus.jettison.mapped

Examples of org.codehaus.jettison.mapped.MappedXMLOutputFactory


        try {

            // Set up the JSON StAX implementation
            Map<String, String> nstojns = new HashMap<String, String>();
            XMLOutputFactory factory = new MappedXMLOutputFactory(nstojns);
            XMLStreamWriter xsw = factory.createXMLStreamWriter(os);
            xsw.writeStartDocument();
            if (obj != null) {

                XmlObject xObj = obj;
                XMLBeanStreamSerializer ser = new XMLBeanStreamSerializer();
View Full Code Here


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

            XMLOutputFactory factory = new MappedXMLOutputFactory(namespaceMap);
            XMLStreamWriter xsw = factory.createXMLStreamWriter(os);           
            ms.marshal(actualObject, xsw);
            xsw.close();
           
        } catch (JAXBException e) {
            throw new WebApplicationException(e);
View Full Code Here

            if (isBadgerFishConventionUsed) {
                xsw = new BadgerFishXMLStreamWriter(writer);
            } else {
                try {
                    xsw =
                        new MappedXMLOutputFactory(outputConfiguration)
                            .createXMLStreamWriter(writer);
                } catch (XMLStreamException e) {
                    logger.error(Messages.getMessage("jaxbFailToMarshal"), t.getName());
                    throw new WebApplicationException(e, Response.Status.INTERNAL_SERVER_ERROR);
                }
View Full Code Here

    private final MappedXMLOutputFactory mof;
    private final MappedXMLInputFactory mif;
   
    public JsonDataFormat() {
        final HashMap nstjsons = new HashMap();
        mof = new MappedXMLOutputFactory(nstjsons);
        mif = new MappedXMLInputFactory(nstjsons);
    }
View Full Code Here

     * @param config the Jettison configuration
     * @param useSerializeAsArray flag to use XStream's hints for collections and arrays
     * @since 1.4
     */
    public JettisonMappedXmlDriver(final Configuration config, final boolean useSerializeAsArray) {
        mof = new MappedXMLOutputFactory(config);
        mif = new MappedXMLInputFactory(config);
        convention = new MappedNamespaceConvention(config);
        this.useSerializeAsArray = useSerializeAsArray;
    }
View Full Code Here

    public JettisonMappedXmlDriver() {
        this(new Configuration(), true);
    }

    public JettisonMappedXmlDriver(final Configuration config, final boolean useSerializeAsArray) {
        mof = new MappedXMLOutputFactory(config);
        mif = new MappedXMLInputFactory(config);
        convention = new MappedNamespaceConvention(config);
        this.useSerializeAsArray = useSerializeAsArray;
    }
View Full Code Here

            if (isBadgerFishConventionUsed) {
                xsw = new BadgerFishXMLStreamWriter(writer);
            } else {
                try {
                    xsw =
                        new MappedXMLOutputFactory(outputConfiguration)
                            .createXMLStreamWriter(writer);
                } catch (XMLStreamException e) {
                    logger.error(Messages.getMessage("jaxbFailToMarshal"), t.getName()); //$NON-NLS-1$
                    throw new WebApplicationException(e, Response.Status.INTERNAL_SERVER_ERROR);
                }
View Full Code Here

        try {

            // Set up the JSON StAX implementation
            Map<String, String> nstojns = new HashMap<String, String>();
            XMLOutputFactory factory = new MappedXMLOutputFactory(nstojns);
            XMLStreamWriter xsw = factory.createXMLStreamWriter(os);
            xsw.writeStartDocument();
            if (obj != null) {

                XmlObject xObj = obj;
                XMLBeanStreamSerializer ser = new XMLBeanStreamSerializer();
View Full Code Here

        nstojns.put("http://book.acme.com", "acme");

        MappedXMLInputFactory xif = new MappedXMLInputFactory(nstojns);
        properties.put(XMLInputFactory.class.getName(), xif);

        MappedXMLOutputFactory xof = new MappedXMLOutputFactory(nstojns);
        properties.put(XMLOutputFactory.class.getName(), xof);

        sfJson.setProperties(properties);

        sfJson.create();
View Full Code Here

        nstojns.put("http://customer.acme.com", "acme");

        MappedXMLInputFactory xif = new MappedXMLInputFactory(nstojns);
        properties.put(XMLInputFactory.class.getName(), xif);

        MappedXMLOutputFactory xof = new MappedXMLOutputFactory(nstojns);
        properties.put(XMLOutputFactory.class.getName(), xof);

        sf.setProperties(properties);

        sf.create();
View Full Code Here

TOP

Related Classes of org.codehaus.jettison.mapped.MappedXMLOutputFactory

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.