Package com.sun.jersey.json.impl.reader

Examples of com.sun.jersey.json.impl.reader.JsonXmlStreamReader


                } catch (Exception ex) {
                    throw new XMLStreamException(ex);
                }
            case MAPPED:
                try {
                    return new JsonXmlStreamReader(nonEmptyReader, rootName, config);
                } catch (IOException ex) {
                    throw new XMLStreamException(ex);
                }
            case MAPPED_JETTISON:
                try {
View Full Code Here


    public void tryReadingBean(String jsonExprFilename, Object expectedJaxbBean,
            JSONConfiguration config) throws JAXBException, IOException {
        Unmarshaller unmarshaller = jaxbContext.createUnmarshaller();
        JAXBElement jaxbElement = unmarshaller.unmarshal(
                new JsonXmlStreamReader(
                    new StringReader(JSONTestHelper.getResourceAsString(PKG_NAME, jsonExprFilename)), config),
                expectedJaxbBean.getClass());
        System.out.println("unmarshalled: " + jaxbElement.getValue().toString());
        assertEquals("MISMATCH:\n" + expectedJaxbBean + "\n" + jaxbElement.getValue() + "\n",
                expectedJaxbBean, jaxbElement.getValue());
View Full Code Here

        executor.execute(new Runnable() {

            @Override
            public void run() {
                try {
                    unmarshaller.unmarshal(new JsonXmlStreamReader(new StringReader(input), config), TwoListsWrapperBean.class);
                } catch (Exception ex) {
                    System.out.println(ex);
                    // an exception does not hurt here
                }
            }
View Full Code Here

                        unmarshal(new InputStreamReader(entityStream, c),
                        type);
                return jaxbElem.getValue();
            } else {
                return u.unmarshal(
                        new JsonXmlStreamReader(
                            new InputStreamReader(entityStream, c),
                            JSONHelper.getRootElementName(type)));
            }
        } 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

        if (u instanceof JSONUnmarshaller) {
            u.setProperty(JSONJAXBContext.JSON_ENABLED, Boolean.TRUE);
            return u.unmarshal(new StreamSource(entityStream), type);
        } else {
            return (JAXBElement) u.unmarshal(
                    new JsonXmlStreamReader(
                        new InputStreamReader(entityStream, getCharset(mediaType)),
                        JSONHelper.getRootElementName((Class<Object>)type)), type);
        }
    }
View Full Code Here

                    Logger.getLogger(JSONUnmarshaller.class.getName()).log(Level.SEVERE, null, ex);
                }
                break;
            case MAPPED:
                try {
                    return new JsonXmlStreamReader(reader, rootName, config.getAttributeAsElements());
                } catch (IOException ex) {
                    Logger.getLogger(JSONUnmarshaller.class.getName()).log(Level.SEVERE, null, ex);
                }
                break;
            case MAPPED_JETTISON:
View Full Code Here

TOP

Related Classes of com.sun.jersey.json.impl.reader.JsonXmlStreamReader

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.