Package com.sun.jersey.json.impl

Examples of com.sun.jersey.json.impl.JSONUnmarshaller.unmarshal()


        final Charset c = getCharset(mediaType);
        if (type.isAnnotationPresent(XmlRootElement.class)) {
            if (u instanceof JSONUnmarshaller) {
                JSONUnmarshaller ju = (JSONUnmarshaller)u;
                ju.setJsonEnabled(true);
                JAXBElement jaxbElem = (JAXBElement)ju.
                        unmarshal(new InputStreamReader(entityStream, c),
                        type);
                return jaxbElem.getValue();
            } else {
                return u.unmarshal(
View Full Code Here


        } else {
            if (u instanceof JSONUnmarshaller) {
                // TODO what about the charset ?
                JSONUnmarshaller ju = (JSONUnmarshaller)u;
                ju.setJsonEnabled(true);
                return ju.unmarshal(new StreamSource(entityStream), type).getValue();
            } else {
                return u.unmarshal(
                        new JsonXmlStreamReader(
                            new InputStreamReader(entityStream, c),
                            JSONHelper.getRootElementName(type)), type).getValue();
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.