Class XmlMapWriter

  • All Implemented Interfaces:
    javax.ws.rs.ext.MessageBodyWriter<Map>

    @Provider
    @Produces("application/xml")
    public class XmlMapWriter
    extends Object
    implements javax.ws.rs.ext.MessageBodyWriter<Map>
    Provider responsible for converting Java maps to an XML formatted stream.
    Author:
    vp 2011.07.18
    • Field Detail

      • m_marshallerRegistry

        @Inject
        protected MarshallerRegistry m_marshallerRegistry
        Marshaller registry to obtain element marshallers from.
    • Constructor Detail

      • XmlMapWriter

        public XmlMapWriter()
    • Method Detail

      • isWriteable

        public boolean isWriteable​(Class<?> clz,
                                   Type type,
                                   Annotation[] aAnnotations,
                                   javax.ws.rs.core.MediaType mediaType)
        Specified by:
        isWriteable in interface javax.ws.rs.ext.MessageBodyWriter<Map>
      • getSize

        public long getSize​(Map map,
                            Class<?> aClass,
                            Type type,
                            Annotation[] aAnnotations,
                            javax.ws.rs.core.MediaType mediaType)
        Specified by:
        getSize in interface javax.ws.rs.ext.MessageBodyWriter<Map>
      • writeTo

        public void writeTo​(Map map,
                            Class<?> clz,
                            Type type,
                            Annotation[] aAnnotation,
                            javax.ws.rs.core.MediaType mediaType,
                            javax.ws.rs.core.MultivaluedMap<String,​Object> httpHeaders,
                            OutputStream stream)
                     throws IOException,
                            javax.ws.rs.WebApplicationException
        Specified by:
        writeTo in interface javax.ws.rs.ext.MessageBodyWriter<Map>
        Throws:
        IOException
        javax.ws.rs.WebApplicationException