Class AbstractEntityProviderModel<T>

  • Direct Known Subclasses:
    ReaderModel, WriterModel

    public abstract class AbstractEntityProviderModel<T>
    extends java.lang.Object
    Abstract entity provider model.
    Since:
    2.16
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private boolean custom  
      private java.util.List<javax.ws.rs.core.MediaType> declaredTypes  
      private java.lang.Class<?> providedType  
      private T provider  
    • Constructor Summary

      Constructors 
      Constructor Description
      AbstractEntityProviderModel​(T provider, java.util.List<javax.ws.rs.core.MediaType> declaredTypes, boolean custom, java.lang.Class<T> providerType)
      Create new entity provider model.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.util.List<javax.ws.rs.core.MediaType> declaredTypes()
      Get types declared as supported (via @Produces or @Consumes) on the entity provider.
      private static java.lang.Class<?> getProviderClassParam​(java.lang.Object provider, java.lang.Class<?> providerType)  
      boolean isCustom()
      Get the custom flag value.
      java.lang.Class<?> providedType()
      Get the provided Java type.
      T provider()
      Get the modelled entity provider instance.
      • Methods inherited from class java.lang.Object

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

      • provider

        private final T provider
      • declaredTypes

        private final java.util.List<javax.ws.rs.core.MediaType> declaredTypes
      • custom

        private final boolean custom
      • providedType

        private final java.lang.Class<?> providedType
    • Constructor Detail

      • AbstractEntityProviderModel

        AbstractEntityProviderModel​(T provider,
                                    java.util.List<javax.ws.rs.core.MediaType> declaredTypes,
                                    boolean custom,
                                    java.lang.Class<T> providerType)
        Create new entity provider model. NOTE: The constructor is package private on purpose as we do not support extensions of this class from another package.
        Parameters:
        provider - entity provider instance.
        declaredTypes - declared supported media types.
        custom - custom flag; true is the provider is custom, false if the provider is one of the default Jersey providers.
        providerType - parameterized entity provider type (used to retrieve the provided Java type).
    • Method Detail

      • provider

        public T provider()
        Get the modelled entity provider instance.
        Returns:
        entity provider instance.
      • declaredTypes

        public java.util.List<javax.ws.rs.core.MediaType> declaredTypes()
        Get types declared as supported (via @Produces or @Consumes) on the entity provider.
        Returns:
        declared supported types.
      • isCustom

        public boolean isCustom()
        Get the custom flag value.
        Returns:
        true if the provider is a custom implementation, false if the provider is one of the default providers supplied with Jersey.
      • providedType

        public java.lang.Class<?> providedType()
        Get the provided Java type.
        Returns:
        provided Java type.
      • getProviderClassParam

        private static java.lang.Class<?> getProviderClassParam​(java.lang.Object provider,
                                                                java.lang.Class<?> providerType)