Interface MarshallerRegistry

    • Method Detail

      • clear

        void clear()
        Be careful !!! That's deregister all marshallers.
        Since:
        7.2
      • register

        void register​(Class<?> marshaller)
               throws MarshallingException
        Makes a marshaller class available.
        Parameters:
        marshaller - The marshaller class.
        Throws:
        MarshallingException - If marshaller class is null or if it's not a valid marshaller.
        Since:
        7.2
      • getWriter

        <T> Writer<T> getWriter​(RenderingContext ctx,
                                Class<T> marshalledClazz,
                                Type genericType,
                                javax.ws.rs.core.MediaType mediatype)
        Provides a Writer instance to manage marshalling of the given Java Type and mimetype.
        Parameters:
        ctx - The marshalling context (see RenderingContext).
        marshalledClazz - The java type to manage.
        genericType - The generic Java type to manage.
        mediatype - The expected mimetype.
        Returns:
        A valid Writer instance.
        Since:
        7.2
      • getUniqueWriter

        <T> Writer<T> getUniqueWriter​(RenderingContext ctx,
                                      Class<T> marshalledClazz,
                                      Type genericType,
                                      javax.ws.rs.core.MediaType mediatype)
        Provides a Writer instance to manage marshalling of the given Java Type and mimetype. It creates a new instance even for Instantiations.SINGLETON marshallers.
        Parameters:
        ctx - The marshalling context (see RenderingContext).
        marshalledClazz - The java type to manage.
        genericType - The generic Java type to manage.
        mediatype - The expected mimetype.
        Returns:
        A valid Writer instance.
        Since:
        7.2
      • getAllWriters

        <T> Collection<Writer<T>> getAllWriters​(RenderingContext ctx,
                                                Class<T> marshalledClazz,
                                                Type genericType,
                                                javax.ws.rs.core.MediaType mediatype)
        Provides all Writer instance that manage marshalling of the given Java Type and mimetype.
        Parameters:
        ctx - The marshalling context (see RenderingContext).
        marshalledClazz - The java type to manage.
        genericType - The generic Java type to manage.
        mediatype - The expected mimetype.
        Returns:
        A list of valid Writer instance.
        Since:
        7.2
      • getReader

        <T> Reader<T> getReader​(RenderingContext ctx,
                                Class<T> marshalledClazz,
                                Type genericType,
                                javax.ws.rs.core.MediaType mediatype)
        Provides a Reader instance to manage marshalling of a mimetype in a Java Type.
        Parameters:
        ctx - The marshalling context (see RenderingContext).
        marshalledClazz - The java type to manage.
        genericType - The generic Java type to manage.
        mediatype - The expected mimetype.
        Returns:
        A valid Reader instance.
        Since:
        7.2
      • getUniqueReader

        <T> Reader<T> getUniqueReader​(RenderingContext ctx,
                                      Class<T> marshalledClazz,
                                      Type genericType,
                                      javax.ws.rs.core.MediaType mediatype)
        Provides a Reader instance to manage marshalling of a mimetype in a Java Type. It creates a new instance even for Instantiations.SINGLETON marshallers.
        Parameters:
        ctx - The marshalling context (see RenderingContext).
        marshalledClazz - The java type to manage.
        genericType - The generic Java type to manage.
        mediatype - The expected mimetype.
        Returns:
        A valid Reader instance.
        Since:
        7.2
      • getAllReaders

        <T> Collection<Reader<T>> getAllReaders​(RenderingContext ctx,
                                                Class<T> marshalledClazz,
                                                Type genericType,
                                                javax.ws.rs.core.MediaType mediatype)
        Provides all Reader instance that manage marshalling of a mimetype in a Java Type.
        Parameters:
        ctx - The marshalling context (see RenderingContext).
        marshalledClazz - The java type to manage.
        genericType - The generic Java type to manage.
        mediatype - The expected mimetype.
        Returns:
        A list of valid Reader instance.
        Since:
        7.2
      • getInstance

        <T> T getInstance​(RenderingContext ctx,
                          Class<T> marshallerClass)
        Provides an instance of a given marshaller class.
        Parameters:
        ctx - The marshalling context (see RenderingContext).
        marshallerClass - A valid marshaller instance.
        Returns:
        A valid marshaller instance.
        Since:
        7.2