Package org.glassfish.jersey.jettison

Examples of org.glassfish.jersey.jettison.JettisonConfig


    @Override
    public final void writeList(Class<?> elementType, Collection<?> t, MediaType mediaType, Charset c, Marshaller m,
                                OutputStream entityStream) throws JAXBException, IOException {
        final OutputStreamWriter osw = new OutputStreamWriter(entityStream, c);

        JettisonConfig origJsonConfig = JettisonConfig.DEFAULT;
        if (m instanceof JettisonConfigured) {
            origJsonConfig = ((JettisonConfigured) m).getJSONConfiguration();
        }

        final JettisonConfig unwrappingJsonConfig = JettisonConfig.createJSONConfiguration(origJsonConfig);

        final XMLStreamWriter jxsw = Stax2JettisonFactory.createWriter(osw, unwrappingJsonConfig);
        final String invisibleRootName = getRootElementName(elementType);

        try {
View Full Code Here


    }

    @Override
    protected final XMLStreamReader getXMLStreamReader(Class<?> elementType, MediaType mediaType, Unmarshaller u,
                                                       InputStream entityStream) throws XMLStreamException {
        JettisonConfig c = JettisonConfig.DEFAULT;
        final Charset charset = getCharset(mediaType);
        if (u instanceof JettisonConfigured) {
            c = ((JettisonConfigured) u).getJSONConfiguration();
        }
View Full Code Here

    private Set<Object> providers = new LinkedHashSet<Object>();

    public static class JettisonMappedJsonTestProvider extends JsonTestProvider {

        public JettisonMappedJsonTestProvider() {
            final JettisonConfig jsonConfiguration =
                    JettisonConfig.mappedJettison().xml2JsonNs(new HashMap<String,
                            String>() {{
                        put("http://www.w3.org/2001/XMLSchema-instance", "xsi");
                        put("http://example.com", "example");
                        put("http://test.jaxb.com", "jaxb");
View Full Code Here

TOP

Related Classes of org.glassfish.jersey.jettison.JettisonConfig

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.