Package org.codehaus.jettison.mapped

Examples of org.codehaus.jettison.mapped.MappedXMLInputFactory


    public static XMLStreamReader createStreamReader(InputStream is, boolean readXsiType,
        ConcurrentHashMap<String, String> namespaceMap) throws Exception {
        if (readXsiType) {
            namespaceMap.putIfAbsent(XSI_URI, XSI_PREFIX);
        }
        MappedXMLInputFactory factory = new MappedXMLInputFactory(namespaceMap);
        return new JettisonReader(namespaceMap, factory.createXMLStreamReader(is));
    }
View Full Code Here


        Map<String, String> nsMap = new HashMap<String, String>();
        nsMap.put("", "");

        // input factory for "Mapped" convention
        MappedXMLInputFactory inputFactory = new MappedXMLInputFactory(nsMap);
        String jsonString = this.getJSONString();
        return inputFactory.createXMLStreamReader(new JSONTokener(jsonString));
    }
View Full Code Here

        Map<String, String> nsMap = new HashMap<String, String>();
        nsMap.put("", "");

        // input factory for "Mapped" convention
        MappedXMLInputFactory inputFactory = new MappedXMLInputFactory(nsMap);
        String jsonString = this.getJSONString();
        return inputFactory.createXMLStreamReader(new JSONTokener(jsonString));
    }
View Full Code Here

        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

     * @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 static XMLStreamReader createStreamReader(InputStream is, boolean readXsiType,
        ConcurrentHashMap<String, String> namespaceMap) throws Exception {
        if (readXsiType) {
            namespaceMap.putIfAbsent(XSI_URI, XSI_PREFIX);
        }
        MappedXMLInputFactory factory = new MappedXMLInputFactory(namespaceMap);
        return new JettisonReader(namespaceMap, factory.createXMLStreamReader(is));
    }
View Full Code Here

                new HashSet<String>(primitiveArrayKeys));
        }
       
        XMLInputFactory factory = depthProps != null
            ? new JettisonMappedReaderFactory(conf, depthProps)
            : new MappedXMLInputFactory(conf);
        return new JettisonReader(namespaceMap, factory.createXMLStreamReader(is));
    }
View Full Code Here

        HashMap XMLToJSNNamespaceMap = new HashMap();
        XMLToJSNNamespaceMap.put("", "");

        //input factory for "Mapped" convention
        MappedXMLInputFactory inputFactory = new MappedXMLInputFactory(XMLToJSNNamespaceMap);
        String jsonString = "{" + localName + ":" + this.getJSONString();
        return inputFactory.createXMLStreamReader(new JSONTokener(jsonString));
    }
View Full Code Here

        try {

            Map<String, String> nstojns = new HashMap<String, String>();

            MappedXMLInputFactory factory = new MappedXMLInputFactory(nstojns);
            XMLStreamReader xsr = factory.createXMLStreamReader(is);
            Reader r = (Reader)xsr;
            result = parseXmlBean(type, r);

            xsr.close();
            result = null;
View Full Code Here

        try {
            Class<?> theType = getActualType(type, genericType);
            JAXBContext context = getJAXBContext(theType, genericType);
            Unmarshaller unmarshaller = context.createUnmarshaller();
           
            MappedXMLInputFactory factory = new MappedXMLInputFactory(namespaceMap);
            XMLStreamReader xsw = factory.createXMLStreamReader(is);
            Object response = null;
            if (JAXBElement.class.isAssignableFrom(type)) {
                response = unmarshaller.unmarshal(xsw, theType);
            } else {
                response = unmarshaller.unmarshal(xsw);
View Full Code Here

TOP

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

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.