Class WriterModel


  • public final class WriterModel
    extends AbstractEntityProviderModel<javax.ws.rs.ext.MessageBodyWriter>
    MessageBodyWriter model.
    Since:
    2.16
    • Constructor Summary

      Constructors 
      Constructor Description
      WriterModel​(javax.ws.rs.ext.MessageBodyWriter provider, java.util.List<javax.ws.rs.core.MediaType> types, java.lang.Boolean custom)
      Create new writer model instance.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean isWriteable​(java.lang.Class<?> type, java.lang.reflect.Type genericType, java.lang.annotation.Annotation[] annotations, javax.ws.rs.core.MediaType mediaType)
      Safely invokes isWriteable method on the underlying provider.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • WriterModel

        public WriterModel​(javax.ws.rs.ext.MessageBodyWriter provider,
                           java.util.List<javax.ws.rs.core.MediaType> types,
                           java.lang.Boolean custom)
        Create new writer model instance. NOTE: This constructor is package-private on purpose.
        Parameters:
        provider - modelled message body writer instance.
        types - supported media types as declared in @Consumes annotation attached to the provider class.
        custom - custom flag.
    • Method Detail

      • isWriteable

        public boolean isWriteable​(java.lang.Class<?> type,
                                   java.lang.reflect.Type genericType,
                                   java.lang.annotation.Annotation[] annotations,
                                   javax.ws.rs.core.MediaType mediaType)
        Safely invokes isWriteable method on the underlying provider. Any exceptions will be logged at finer level.
        Parameters:
        type - the class of instance that is to be written.
        genericType - the type of instance to be written, obtained either by reflection of a resource method return type or via inspection of the returned instance. GenericEntity provides a way to specify this information at runtime.
        annotations - an array of the annotations attached to the message entity instance.
        mediaType - the media type of the HTTP entity.
        Returns:
        true if the type is supported, otherwise false.