Package org.codehaus.jettison.mapped

Examples of org.codehaus.jettison.mapped.MappedXMLInputFactory


        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


    protected XMLStreamReader createStreamReader(Class<?> type, InputStream is) throws Exception {
        if (readXsiType) {
            namespaceMap.putIfAbsent("http://www.w3.org/2001/XMLSchema-instance", "xsins");
        }
        getQName(type);
        MappedXMLInputFactory factory = new MappedXMLInputFactory(namespaceMap);
        return new NamespaceContextReader(factory.createXMLStreamReader(is));
    }
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

            JAXBContext context = getJAXBContext(type);
            Unmarshaller unmarshaller = context.createUnmarshaller();
           
            Map<String, String> nstojns = new HashMap<String, String>();
           
            MappedXMLInputFactory factory = new MappedXMLInputFactory(nstojns);
            XMLStreamReader xsw = factory.createXMLStreamReader(is);           
            Object obj = unmarshaller.unmarshal(xsw);
            xsw.close();
            return obj;
        } catch (JAXBException e) {
            e.printStackTrace();        
View Full Code Here

        // Set up the JSON StAX implementation
        Map<String, String> nstojns = new HashMap<String, String>();
        nstojns.put("http://demo.restful.server", "acme");

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

        MappedXMLOutputFactory xof = new MappedXMLOutputFactory(nstojns);
        properties.put(XMLOutputFactory.class.getName(), xof);
View Full Code Here

       
        try {
            Class<?> theType = getActualType(type, genericType);
            Unmarshaller unmarshaller = createUnmarshaller(theType, genericType);
           
            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

        if (readXsiType) {
            namespaceMap.putIfAbsent(XSI_URI, XSI_PREFIX);
        }
        XMLInputFactory factory = depthProps != null
            ? new JettisonMappedReaderFactory(namespaceMap, depthProps)
            : new MappedXMLInputFactory(namespaceMap);
        return new JettisonReader(namespaceMap, factory.createXMLStreamReader(is));
    }
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, anns);
           
            Unmarshaller unmarshaller = createUnmarshaller(theType, genericType);
           
            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

        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

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.