Package org.jboss.resteasy.spi

## Class ResteasyProviderFactory

- java.lang.Object
- - javax.ws.rs.ext.RuntimeDelegate
  - - org.jboss.resteasy.spi.ResteasyProviderFactory

- All Implemented Interfaces:
    `javax.ws.rs.core.Configurable<ResteasyProviderFactory>`, `javax.ws.rs.core.Configuration`, `javax.ws.rs.ext.Providers`, `HeaderValueProcessor`
  Direct Known Subclasses:
    `ResteasyProviderFactoryDelegate`, `ResteasyProviderFactoryImpl`

      public abstract class ResteasyProviderFactory
      extends javax.ws.rs.ext.RuntimeDelegate
      implements javax.ws.rs.ext.Providers, HeaderValueProcessor, javax.ws.rs.core.Configurable<ResteasyProviderFactory>, javax.ws.rs.core.Configuration

  Version:
    $Revision: 1 $
  Author:
    Bill Burke

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from class javax.ws.rs.ext.RuntimeDelegate

      `javax.ws.rs.ext.RuntimeDelegate.HeaderDelegate<T extends Object>`

  - ### Field Summary

    - ### Fields inherited from class javax.ws.rs.ext.RuntimeDelegate

      `JAXRS_RUNTIME_DELEGATE_PROPERTY`

  - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `ResteasyProviderFactory()` |

  - ### Method Summary

    All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Deprecated Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `abstract void` | `addHeaderDelegate​(Class clazz, javax.ws.rs.ext.RuntimeDelegate.HeaderDelegate header)` |
    `static void` | `clearInstanceIfEqual​(ResteasyProviderFactory factory)` |
    `abstract <T> T` | `createProviderInstance​(Class<? extends T> clazz)` | Create an instance of a class using provider allocation rules of the specification as well as the InjectorFactory only does constructor injection.
    `abstract <T> StringParameterUnmarshaller<T>` | `createStringParameterUnmarshaller​(Class<T> clazz)` |
    `abstract <T> AsyncClientResponseProvider<T>` | `getAsyncClientResponseProvider​(Class<T> type)` |
    `abstract Map<Class<?>,​AsyncClientResponseProvider>` | `getAsyncClientResponseProviders()` |
    `abstract Map<Type,​ContextInjector>` | `getAsyncContextInjectors()` |
    `abstract <T> AsyncResponseProvider<T>` | `getAsyncResponseProvider​(Class<T> type)` |
    `abstract Map<Class<?>,​AsyncResponseProvider>` | `getAsyncResponseProviders()` |
    `abstract <T> AsyncStreamProvider<T>` | `getAsyncStreamProvider​(Class<T> type)` |
    `abstract Map<Class<?>,​AsyncStreamProvider>` | `getAsyncStreamProviders()` |
    `abstract Set<javax.ws.rs.container.DynamicFeature>` | `getClientDynamicFeatures()` |
    `abstract <T> javax.ws.rs.ext.MessageBodyReader<T>` | `getClientMessageBodyReader​(Class<T> type, Type genericType, Annotation[] annotations, javax.ws.rs.core.MediaType mediaType)` |
    `abstract <T> javax.ws.rs.ext.MessageBodyWriter<T>` | `getClientMessageBodyWriter​(Class<T> type, Type genericType, Annotation[] annotations, javax.ws.rs.core.MediaType mediaType)` |
    `abstract JaxrsInterceptorRegistry<javax.ws.rs.ext.ReaderInterceptor>` | `getClientReaderInterceptorRegistry()` |
    `abstract JaxrsInterceptorRegistry<javax.ws.rs.client.ClientRequestFilter>` | `getClientRequestFilterRegistry()` |
    `abstract JaxrsInterceptorRegistry<javax.ws.rs.client.ClientResponseFilter>` | `getClientResponseFilters()` |
    `abstract JaxrsInterceptorRegistry<javax.ws.rs.ext.WriterInterceptor>` | `getClientWriterInterceptorRegistry()` |
    `abstract javax.ws.rs.core.MediaType` | `getConcreteMediaTypeFromMessageBodyWriters​(Class<?> type, Type genericType, Annotation[] annotations, javax.ws.rs.core.MediaType mediaType)` |
    `abstract JaxrsInterceptorRegistry<javax.ws.rs.container.ContainerRequestFilter>` | `getContainerRequestFilterRegistry()` |
    `abstract JaxrsInterceptorRegistry<javax.ws.rs.container.ContainerResponseFilter>` | `getContainerResponseFilterRegistry()` |
    `abstract <T> T` | `getContextData​(Class<T> type)` |
    `abstract <T> T` | `getContextData​(Class<T> rawType, Type genericType, Annotation[] annotations, boolean unwrapAsync)` |
    `abstract Map<Type,​ContextInjector>` | `getContextInjectors()` |
    `abstract List<javax.ws.rs.ext.ContextResolver>` | `getContextResolvers​(Class<?> clazz, javax.ws.rs.core.MediaType type)` |
    `abstract Collection<javax.ws.rs.core.Feature>` | `getEnabledFeatures()` |
    `abstract javax.ws.rs.ext.RuntimeDelegate.HeaderDelegate` | `getHeaderDelegate​(Class<?> aClass)` | Checks to see if RuntimeDelegate is a ResteasyProviderFactory If it is, then use that, otherwise use this.
    `abstract InjectorFactory` | `getInjectorFactory()` |
    `static ResteasyProviderFactory` | `getInstance()` | Initializes ResteasyProviderFactory singleton if not set.
    `abstract Map<String,​Object>` | `getMutableProperties()` |
    `abstract javax.ws.rs.ext.ParamConverter` | `getParamConverter​(Class clazz, Type genericType, Annotation[] annotations)` |
    `abstract Map<javax.ws.rs.ext.MessageBodyWriter<?>,​Class<?>>` | `getPossibleMessageBodyWritersMap​(Class type, Type genericType, Annotation[] annotations, javax.ws.rs.core.MediaType accept)` |
    `abstract Set<Class<?>>` | `getProviderClasses()` |
    `abstract Set<Object>` | `getProviderInstances()` |
    `abstract ResourceBuilder` | `getResourceBuilder()` |
    `abstract <I extends javax.ws.rs.client.RxInvoker> javax.ws.rs.client.RxInvokerProvider<I>` | `getRxInvokerProvider​(Class<I> clazz)` |
    `abstract javax.ws.rs.client.RxInvokerProvider<?>` | `getRxInvokerProviderFromReactiveClass​(Class<?> clazz)` |
    `abstract Set<javax.ws.rs.container.DynamicFeature>` | `getServerDynamicFeatures()` |
    `abstract <T> javax.ws.rs.ext.MessageBodyReader<T>` | `getServerMessageBodyReader​(Class<T> type, Type genericType, Annotation[] annotations, javax.ws.rs.core.MediaType mediaType)` | Deprecated.
    `abstract <T> javax.ws.rs.ext.MessageBodyWriter<T>` | `getServerMessageBodyWriter​(Class<T> type, Type genericType, Annotation[] annotations, javax.ws.rs.core.MediaType mediaType)` | Deprecated.
    `abstract JaxrsInterceptorRegistry<javax.ws.rs.ext.ReaderInterceptor>` | `getServerReaderInterceptorRegistry()` |
    `abstract JaxrsInterceptorRegistry<javax.ws.rs.ext.WriterInterceptor>` | `getServerWriterInterceptorRegistry()` |
    `abstract StatisticsController` | `getStatisticsController()` |
    `abstract void` | `initializeClientProviders​(ResteasyProviderFactory factory)` |
    `abstract <T> T` | `injectedInstance​(Class<? extends T> clazz)` | Property and constructor injection using the InjectorFactory.
    `abstract <T> T` | `injectedInstance​(Class<? extends T> clazz, HttpRequest request, HttpResponse response)` | Property and constructor injection using the InjectorFactory.
    `abstract void` | `injectProperties​(Object obj)` |
    `abstract void` | `injectProperties​(Object obj, HttpRequest request, HttpResponse response)` |
    `static boolean` | `isA​(Class target, Class type, Set<Class<?>> contracts)` |
    `static boolean` | `isA​(Object target, Class type, Set<Class<?>> contracts)` |
    `abstract boolean` | `isBuiltinsRegistered()` |
    `protected abstract boolean` | `isOnServer()` |
    `abstract boolean` | `isReactive​(Class<?> clazz)` |
    `abstract boolean` | `isRegisterBuiltins()` |
    `static ResteasyProviderFactory` | `newInstance()` |
    `static ResteasyProviderFactory` | `peekInstance()` | Will not initialize singleton if not set.
    `protected abstract void` | `registerBuiltin()` |
    `abstract void` | `registerProvider​(Class provider)` |
    `abstract void` | `registerProvider​(Class provider, boolean isBuiltin)` | Register a @Provider class.
    `abstract void` | `registerProvider​(Class provider, Integer priorityOverride, boolean isBuiltin, Map<Class<?>,​Integer> contracts)` |
    `abstract void` | `registerProviderInstance​(Object provider)` | Register a @Provider object.
    `abstract void` | `registerProviderInstance​(Object provider, Map<Class<?>,​Integer> contracts, Integer priorityOverride, boolean builtIn)` |
    `abstract void` | `setBuiltinsRegistered​(boolean builtinsRegistered)` |
    `abstract void` | `setInjectorFactory​(InjectorFactory injectorFactory)` |
    `static void` | `setInstance​(ResteasyProviderFactory factory)` |
    `abstract ResteasyProviderFactory` | `setProperties​(Map<String,​Object> properties)` |
    `static void` | `setRegisterBuiltinByDefault​(boolean registerBuiltinByDefault)` |
    `abstract void` | `setRegisterBuiltins​(boolean registerBuiltins)` |
    `abstract String` | `toString​(Object object, Class clazz, Type genericType, Annotation[] annotations)` | Convert an object to a string.

    - ### Methods inherited from class javax.ws.rs.ext.RuntimeDelegate

      `createEndpoint, createHeaderDelegate, createLinkBuilder, createResponseBuilder, createUriBuilder, createVariantListBuilder, setInstance`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

    - ### Methods inherited from interface javax.ws.rs.core.Configurable

      `getConfiguration, property, register, register, register, register, register, register, register, register`

    - ### Methods inherited from interface javax.ws.rs.core.Configuration

      `getClasses, getContracts, getInstances, getProperties, getProperty, getPropertyNames, getRuntimeType, isEnabled, isEnabled, isRegistered, isRegistered`

    - ### Methods inherited from interface org.jboss.resteasy.spi.HeaderValueProcessor

      `toHeaderString`

    - ### Methods inherited from interface javax.ws.rs.ext.Providers

      `getContextResolver, getExceptionMapper, getMessageBodyReader, getMessageBodyWriter`

- - ### Constructor Detail

    - #### ResteasyProviderFactory

          public ResteasyProviderFactory()

  - ### Method Detail

    - #### getServerDynamicFeatures

          public abstract Set<javax.ws.rs.container.DynamicFeature> getServerDynamicFeatures()

    - #### getClientDynamicFeatures

          public abstract Set<javax.ws.rs.container.DynamicFeature> getClientDynamicFeatures()

    - #### getAsyncResponseProviders

          public abstract Map<Class<?>,​AsyncResponseProvider> getAsyncResponseProviders()

    - #### getAsyncClientResponseProviders

          public abstract Map<Class<?>,​AsyncClientResponseProvider> getAsyncClientResponseProviders()

    - #### getAsyncStreamProviders

          public abstract Map<Class<?>,​AsyncStreamProvider> getAsyncStreamProviders()

    - #### getContextInjectors

          public abstract Map<Type,​ContextInjector> getContextInjectors()

    - #### getAsyncContextInjectors

          public abstract Map<Type,​ContextInjector> getAsyncContextInjectors()

    - #### getProviderClasses

          public abstract Set<Class<?>> getProviderClasses()

    - #### getProviderInstances

          public abstract Set<Object> getProviderInstances()

    - #### getContextData

          public abstract <T> T getContextData​(Class<T> type)

    - #### getContextData

          public abstract <T> T getContextData​(Class<T> rawType,
                                               Type genericType,
                                               Annotation[] annotations,
                                               boolean unwrapAsync)

    - #### peekInstance

          public static ResteasyProviderFactory peekInstance()

      Will not initialize singleton if not set.
      Returns:
        provider factory singleton

    - #### clearInstanceIfEqual

          public static void clearInstanceIfEqual​(ResteasyProviderFactory factory)

    - #### setInstance

          public static void setInstance​(ResteasyProviderFactory factory)

    - #### getInstance

          public static ResteasyProviderFactory getInstance()

      Initializes ResteasyProviderFactory singleton if not set.
      Returns:
        singleton provider factory

    - #### newInstance

          public static ResteasyProviderFactory newInstance()

    - #### setRegisterBuiltinByDefault

          public static void setRegisterBuiltinByDefault​(boolean registerBuiltinByDefault)

    - #### isA

          public static boolean isA​(Class target,
                                    Class type,
                                    Set<Class<?>> contracts)

    - #### isA

          public static boolean isA​(Object target,
                                    Class type,
                                    Set<Class<?>> contracts)

    - #### registerBuiltin

          protected abstract void registerBuiltin()

    - #### isRegisterBuiltins

          public abstract boolean isRegisterBuiltins()

    - #### setRegisterBuiltins

          public abstract void setRegisterBuiltins​(boolean registerBuiltins)

    - #### getInjectorFactory

          public abstract InjectorFactory getInjectorFactory()

    - #### setInjectorFactory

          public abstract void setInjectorFactory​(InjectorFactory injectorFactory)

    - #### getServerReaderInterceptorRegistry

          public abstract JaxrsInterceptorRegistry<javax.ws.rs.ext.ReaderInterceptor> getServerReaderInterceptorRegistry()

    - #### getServerWriterInterceptorRegistry

          public abstract JaxrsInterceptorRegistry<javax.ws.rs.ext.WriterInterceptor> getServerWriterInterceptorRegistry()

    - #### getContainerRequestFilterRegistry

          public abstract JaxrsInterceptorRegistry<javax.ws.rs.container.ContainerRequestFilter> getContainerRequestFilterRegistry()

    - #### getContainerResponseFilterRegistry

          public abstract JaxrsInterceptorRegistry<javax.ws.rs.container.ContainerResponseFilter> getContainerResponseFilterRegistry()

    - #### getClientReaderInterceptorRegistry

          public abstract JaxrsInterceptorRegistry<javax.ws.rs.ext.ReaderInterceptor> getClientReaderInterceptorRegistry()

    - #### getClientWriterInterceptorRegistry

          public abstract JaxrsInterceptorRegistry<javax.ws.rs.ext.WriterInterceptor> getClientWriterInterceptorRegistry()

    - #### getClientRequestFilterRegistry

          public abstract JaxrsInterceptorRegistry<javax.ws.rs.client.ClientRequestFilter> getClientRequestFilterRegistry()

    - #### getClientResponseFilters

          public abstract JaxrsInterceptorRegistry<javax.ws.rs.client.ClientResponseFilter> getClientResponseFilters()

    - #### isBuiltinsRegistered

          public abstract boolean isBuiltinsRegistered()

    - #### setBuiltinsRegistered

          public abstract void setBuiltinsRegistered​(boolean builtinsRegistered)

    - #### addHeaderDelegate

          public abstract void addHeaderDelegate​(Class clazz,
                                                 javax.ws.rs.ext.RuntimeDelegate.HeaderDelegate header)

    - #### getServerMessageBodyReader

          @Deprecated
          public abstract <T> javax.ws.rs.ext.MessageBodyReader<T> getServerMessageBodyReader​(Class<T> type,
                                                                                              Type genericType,
                                                                                              Annotation[] annotations,
                                                                                              javax.ws.rs.core.MediaType mediaType)

      Deprecated.

    - #### getClientMessageBodyReader

          public abstract <T> javax.ws.rs.ext.MessageBodyReader<T> getClientMessageBodyReader​(Class<T> type,
                                                                                              Type genericType,
                                                                                              Annotation[] annotations,
                                                                                              javax.ws.rs.core.MediaType mediaType)

    - #### getContextResolvers

          public abstract List<javax.ws.rs.ext.ContextResolver> getContextResolvers​(Class<?> clazz,
                                                                                    javax.ws.rs.core.MediaType type)

    - #### getParamConverter

          public abstract javax.ws.rs.ext.ParamConverter getParamConverter​(Class clazz,
                                                                           Type genericType,
                                                                           Annotation[] annotations)

    - #### createStringParameterUnmarshaller

          public abstract <T> StringParameterUnmarshaller<T> createStringParameterUnmarshaller​(Class<T> clazz)

    - #### registerProvider

          public abstract void registerProvider​(Class provider)

    - #### toString

          public abstract String toString​(Object object,
                                          Class clazz,
                                          Type genericType,
                                          Annotation[] annotations)

      Convert an object to a string. First try StringConverter then, object.ToString()
      Parameters:
        `object` - object
        `clazz` - class
        `genericType` - generic type
        `annotations` - array of annotation
      Returns:
        string representation

    - #### getHeaderDelegate

          public abstract javax.ws.rs.ext.RuntimeDelegate.HeaderDelegate getHeaderDelegate​(Class<?> aClass)

      Checks to see if RuntimeDelegate is a ResteasyProviderFactory If it is, then use that, otherwise use this.
      Parameters:
        `aClass` - class of the header
      Returns:
        header delegate

    - #### registerProvider

          public abstract void registerProvider​(Class provider,
                                                boolean isBuiltin)

      Register a @Provider class. Can be a MessageBodyReader/Writer or ExceptionMapper.
      Parameters:
        `provider` - provider class
        `isBuiltin` - built-in

    - #### registerProvider

          public abstract void registerProvider​(Class provider,
                                                Integer priorityOverride,
                                                boolean isBuiltin,
                                                Map<Class<?>,​Integer> contracts)

    - #### registerProviderInstance

          public abstract void registerProviderInstance​(Object provider)

      Register a @Provider object. Can be a MessageBodyReader/Writer or ExceptionMapper.
      Parameters:
        `provider` - provider instance

    - #### registerProviderInstance

          public abstract void registerProviderInstance​(Object provider,
                                                        Map<Class<?>,​Integer> contracts,
                                                        Integer priorityOverride,
                                                        boolean builtIn)

    - #### getAsyncResponseProvider

          public abstract <T> AsyncResponseProvider<T> getAsyncResponseProvider​(Class<T> type)

    - #### getAsyncClientResponseProvider

          public abstract <T> AsyncClientResponseProvider<T> getAsyncClientResponseProvider​(Class<T> type)

    - #### getAsyncStreamProvider

          public abstract <T> AsyncStreamProvider<T> getAsyncStreamProvider​(Class<T> type)

    - #### getConcreteMediaTypeFromMessageBodyWriters

          public abstract javax.ws.rs.core.MediaType getConcreteMediaTypeFromMessageBodyWriters​(Class<?> type,
                                                                                                Type genericType,
                                                                                                Annotation[] annotations,
                                                                                                javax.ws.rs.core.MediaType mediaType)

    - #### getPossibleMessageBodyWritersMap

          public abstract Map<javax.ws.rs.ext.MessageBodyWriter<?>,​Class<?>> getPossibleMessageBodyWritersMap​(Class type,
                                                                                                                    Type genericType,
                                                                                                                    Annotation[] annotations,
                                                                                                                    javax.ws.rs.core.MediaType accept)

    - #### getServerMessageBodyWriter

          @Deprecated
          public abstract <T> javax.ws.rs.ext.MessageBodyWriter<T> getServerMessageBodyWriter​(Class<T> type,
                                                                                              Type genericType,
                                                                                              Annotation[] annotations,
                                                                                              javax.ws.rs.core.MediaType mediaType)

      Deprecated.

    - #### getClientMessageBodyWriter

          public abstract <T> javax.ws.rs.ext.MessageBodyWriter<T> getClientMessageBodyWriter​(Class<T> type,
                                                                                              Type genericType,
                                                                                              Annotation[] annotations,
                                                                                              javax.ws.rs.core.MediaType mediaType)

    - #### createProviderInstance

          public abstract <T> T createProviderInstance​(Class<? extends T> clazz)

      Create an instance of a class using provider allocation rules of the specification as well as the InjectorFactory only does constructor injection.
      Type Parameters:
        `T` - type
      Parameters:
        `clazz` - class
      Returns:
        provider instance of type T

    - #### injectedInstance

          public abstract <T> T injectedInstance​(Class<? extends T> clazz)

      Property and constructor injection using the InjectorFactory.
      Type Parameters:
        `T` - type
      Parameters:
        `clazz` - class
      Returns:
        instance of type T

    - #### injectedInstance

          public abstract <T> T injectedInstance​(Class<? extends T> clazz,
                                                 HttpRequest request,
                                                 HttpResponse response)

      Property and constructor injection using the InjectorFactory.
      Type Parameters:
        `T` - type
      Parameters:
        `clazz` - class
        `request` - http request
        `response` - http response
      Returns:
        instance of type T

    - #### injectProperties

          public abstract void injectProperties​(Object obj)

    - #### injectProperties

          public abstract void injectProperties​(Object obj,
                                                HttpRequest request,
                                                HttpResponse response)

    - #### getMutableProperties

          public abstract Map<String,​Object> getMutableProperties()

    - #### setProperties

          public abstract ResteasyProviderFactory setProperties​(Map<String,​Object> properties)

    - #### getEnabledFeatures

          public abstract Collection<javax.ws.rs.core.Feature> getEnabledFeatures()

    - #### getRxInvokerProvider

          public abstract <I extends javax.ws.rs.client.RxInvoker> javax.ws.rs.client.RxInvokerProvider<I> getRxInvokerProvider​(Class<I> clazz)

    - #### getRxInvokerProviderFromReactiveClass

          public abstract javax.ws.rs.client.RxInvokerProvider<?> getRxInvokerProviderFromReactiveClass​(Class<?> clazz)

    - #### isReactive

          public abstract boolean isReactive​(Class<?> clazz)

    - #### getResourceBuilder

          public abstract ResourceBuilder getResourceBuilder()

    - #### initializeClientProviders

          public abstract void initializeClientProviders​(ResteasyProviderFactory factory)

    - #### getStatisticsController

          public abstract StatisticsController getStatisticsController()

    - #### isOnServer

          protected abstract boolean isOnServer()