Package com.fasterxml.jackson.jaxrs.xml.annotation

Examples of com.fasterxml.jackson.jaxrs.xml.annotation.EndpointConfig


     */
    public Object readFrom(Class<Object> type, Type genericType, Annotation[] annotations, MediaType mediaType, MultivaluedMap<String,String> httpHeaders, InputStream entityStream)
        throws IOException
    {
        AnnotationBundleKey key = new AnnotationBundleKey(annotations);
        EndpointConfig endpoint;
        synchronized (_readers) {
            endpoint = _readers.get(key);
        }
        // not yet resolved (or not cached any more)? Resolve!
        if (endpoint == null) {
            XmlMapper mapper = locateMapper(type, mediaType);
            endpoint = EndpointConfig.forReading(mapper, annotations);
            // and cache for future reuse
            synchronized (_readers) {
                _readers.put(key.immutableKey(), endpoint);
            }
        }
        ObjectReader reader = endpoint.getReader();
        // Fix for [Issue#4]: note, can not try to advance parser, XML parser complains
        PushbackInputStream wrappedStream = new PushbackInputStream(entityStream);
        int firstByte = wrappedStream.read();
        if (firstByte == -1) {
            return null;
View Full Code Here


    public void writeTo(Object value, Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType,
            MultivaluedMap<String,Object> httpHeaders, OutputStream entityStream)
        throws IOException
    {
        AnnotationBundleKey key = new AnnotationBundleKey(annotations);
        EndpointConfig endpoint;
        synchronized (_writers) {
            endpoint = _writers.get(key);
        }
        // not yet resolved (or not cached any more)? Resolve!
        if (endpoint == null) {
            XmlMapper mapper = locateMapper(type, mediaType);
            endpoint = EndpointConfig.forWriting(mapper, annotations);
            // and cache for future reuse
            synchronized (_writers) {
                _writers.put(key.immutableKey(), endpoint);
            }
        }

        ObjectWriter writer = endpoint.getWriter();
       
        /* 27-Feb-2009, tatu: Where can we find desired encoding? Within
         *   HTTP headers?
         */
        JsonEncoding enc = findEncoding(mediaType, httpHeaders);
View Full Code Here

     */
    public Object readFrom(Class<Object> type, Type genericType, Annotation[] annotations, MediaType mediaType, MultivaluedMap<String,String> httpHeaders, InputStream entityStream)
        throws IOException
    {
        AnnotationBundleKey key = new AnnotationBundleKey(annotations);
        EndpointConfig endpoint;
        synchronized (_readers) {
            endpoint = _readers.get(key);
        }
        // not yet resolved (or not cached any more)? Resolve!
        if (endpoint == null) {
            XmlMapper mapper = locateMapper(type, mediaType);
            endpoint = EndpointConfig.forReading(mapper, annotations);
            // and cache for future reuse
            synchronized (_readers) {
                _readers.put(key.immutableKey(), endpoint);
            }
        }
        ObjectReader reader = endpoint.getReader();
        JsonParser jp = reader.getJsonFactory().createJsonParser(entityStream);
        return reader.withType(genericType).readValue(jp);
    }
View Full Code Here

    public void writeTo(Object value, Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType,
            MultivaluedMap<String,Object> httpHeaders, OutputStream entityStream)
        throws IOException
    {
        AnnotationBundleKey key = new AnnotationBundleKey(annotations);
        EndpointConfig endpoint;
        synchronized (_writers) {
            endpoint = _writers.get(key);
        }
        // not yet resolved (or not cached any more)? Resolve!
        if (endpoint == null) {
            XmlMapper mapper = locateMapper(type, mediaType);
            endpoint = EndpointConfig.forWriting(mapper, annotations);
            // and cache for future reuse
            synchronized (_writers) {
                _writers.put(key.immutableKey(), endpoint);
            }
        }

        ObjectWriter writer = endpoint.getWriter();
       
        /* 27-Feb-2009, tatu: Where can we find desired encoding? Within
         *   HTTP headers?
         */
        JsonEncoding enc = findEncoding(mediaType, httpHeaders);
View Full Code Here

     */
    public Object readFrom(Class<Object> type, Type genericType, Annotation[] annotations, MediaType mediaType, MultivaluedMap<String,String> httpHeaders, InputStream entityStream)
        throws IOException
    {
        AnnotationBundleKey key = new AnnotationBundleKey(annotations);
        EndpointConfig endpoint;
        synchronized (_readers) {
            endpoint = _readers.get(key);
        }
        // not yet resolved (or not cached any more)? Resolve!
        if (endpoint == null) {
            XmlMapper mapper = locateMapper(type, mediaType);
            endpoint = EndpointConfig.forReading(mapper, annotations);
            // and cache for future reuse
            synchronized (_readers) {
                _readers.put(key.immutableKey(), endpoint);
            }
        }
        ObjectReader reader = endpoint.getReader();
        JsonParser jp = reader.getJsonFactory().createJsonParser(entityStream);
        return reader.withType(genericType).readValue(jp);
    }
View Full Code Here

    public void writeTo(Object value, Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType,
            MultivaluedMap<String,Object> httpHeaders, OutputStream entityStream)
        throws IOException
    {
        AnnotationBundleKey key = new AnnotationBundleKey(annotations);
        EndpointConfig endpoint;
        synchronized (_writers) {
            endpoint = _writers.get(key);
        }
        // not yet resolved (or not cached any more)? Resolve!
        if (endpoint == null) {
            XmlMapper mapper = locateMapper(type, mediaType);
            endpoint = EndpointConfig.forWriting(mapper, annotations);
            // and cache for future reuse
            synchronized (_writers) {
                _writers.put(key.immutableKey(), endpoint);
            }
        }

        ObjectWriter writer = endpoint.getWriter();
       
        /* 27-Feb-2009, tatu: Where can we find desired encoding? Within
         *   HTTP headers?
         */
        JsonEncoding enc = findEncoding(mediaType, httpHeaders);
View Full Code Here

TOP

Related Classes of com.fasterxml.jackson.jaxrs.xml.annotation.EndpointConfig

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.