Class SingletonProvider

    • Field Summary

      Fields 
      Modifier and Type Field Description
      private javax.ws.rs.ext.ContextResolver<?> contextResolver
      Deprecated.
      the ContextResolver, if this providers is a ContextResolver
      private javax.ws.rs.ext.ExceptionMapper<? extends java.lang.Throwable> excMapper
      Deprecated.
       
      private java.lang.Object jaxRsProvider
      Deprecated.
       
      private javax.ws.rs.ext.MessageBodyReader<?> reader
      Deprecated.
      The JAX-RS MessageBodyReader this wrapper represent.
      private javax.ws.rs.ext.MessageBodyWriter<java.lang.Object> writer
      Deprecated.
       
    • Constructor Summary

      Constructors 
      Constructor Description
      SingletonProvider​(java.lang.Object jaxRsProvider, java.util.logging.Logger logger)
      Deprecated.
       
    • Method Summary

      All Methods Instance Methods Concrete Methods Deprecated Methods 
      Modifier and Type Method Description
      boolean equals​(java.lang.Object otherProvider)
      Deprecated.
       
      java.lang.String getClassName()
      Deprecated.
       
      javax.ws.rs.ext.ContextResolver<?> getContextResolver()
      Deprecated.
      Returns the wrapped ContextResolver
      javax.ws.rs.ext.ExceptionMapper<? extends java.lang.Throwable> getExcMapper()
      Deprecated.
      Returns the ExceptionMapper, or null, if this provider is not an ExceptionMapper.
      java.lang.Class<?> getExcMapperType()
      Deprecated.
      Beispiele: ExceptionMapper<IllegalArgumentException> -> IllegalArgumentException MessageBodyReader<Integer> -> Integer
      ContextResolver getInitializedCtxResolver()
      Deprecated.
       
      javax.ws.rs.ext.ExceptionMapper<? extends java.lang.Throwable> getInitializedExcMapper()
      Deprecated.
       
      MessageBodyReader getInitializedReader()
      Deprecated.
       
      MessageBodyWriter getInitializedWriter()
      Deprecated.
       
      javax.ws.rs.ext.MessageBodyReader<?> getJaxRsReader()
      Deprecated.
      Returns the JAX-RS MessageBodyReader.
      javax.ws.rs.ext.MessageBodyWriter<java.lang.Object> getJaxRsWriter()
      Deprecated.
      Returns the JAX-RS MessageBodyWriter.
      long getSize​(java.lang.Object t, java.lang.Class<?> type, java.lang.reflect.Type genericType, java.lang.annotation.Annotation[] annotations, MediaType mediaType)
      Deprecated.
      Called before writeTo to ascertain the length in bytes of the serialized form of t.
      int hashCode()
      Deprecated.
       
      void initAtAppStartUp​(ThreadLocalizedContext tlContext, javax.ws.rs.ext.Providers allProviders, ExtensionBackwardMapping extensionBackwardMapping)
      Deprecated.
      Injects the supported dependencies into this provider and calls the method annotated with @PostConstruct.
      boolean isContextResolver()
      Deprecated.
      Returns true, if this ProviderWrapper is also a ContextResolver, otherwise false.
      boolean isExceptionMapper()
      Deprecated.
      Checks, if this provider represents an ExceptionMapper.
      boolean isReadable​(java.lang.Class<?> type, java.lang.reflect.Type genericType, java.lang.annotation.Annotation[] annotations, javax.ws.rs.core.MediaType mediaType)
      Deprecated.
      Checks, if this MessageBodyReader could read the given type.
      boolean isReader()
      Deprecated.
      Returns true, if this ProviderWrapper is also a MessageBodyReader, otherwise false.
      boolean isWriteable​(java.lang.Class<?> type, java.lang.reflect.Type genericType, java.lang.annotation.Annotation[] annotations, javax.ws.rs.core.MediaType mediaType)
      Deprecated.
      Checks, if the given class could be written by this MessageBodyWriter.
      boolean isWriter()
      Deprecated.
      Returns true, if this ProviderWrapper is also a MessageBodyWriter, otherwise false.
      java.lang.Object readFrom​(java.lang.Class<?> type, java.lang.reflect.Type genericType, java.lang.annotation.Annotation[] annotations, MediaType mediaType, CharacterSet characterSet, javax.ws.rs.core.MultivaluedMap<java.lang.String,​java.lang.String> httpHeaders, java.io.InputStream entityStream)
      Deprecated.
       
      void writeTo​(java.lang.Object object, java.lang.Class<?> type, java.lang.reflect.Type genericType, java.lang.annotation.Annotation[] annotations, MediaType mediaType, javax.ws.rs.core.MultivaluedMap<java.lang.String,​java.lang.Object> httpHeaders, java.io.OutputStream entityStream)
      Deprecated.
      Write a type to an HTTP response.
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
    • Field Detail

      • contextResolver

        private final javax.ws.rs.ext.ContextResolver<?> contextResolver
        Deprecated.
        the ContextResolver, if this providers is a ContextResolver
      • excMapper

        private final javax.ws.rs.ext.ExceptionMapper<? extends java.lang.Throwable> excMapper
        Deprecated.
      • jaxRsProvider

        private final java.lang.Object jaxRsProvider
        Deprecated.
      • reader

        private final javax.ws.rs.ext.MessageBodyReader<?> reader
        Deprecated.
        The JAX-RS MessageBodyReader this wrapper represent.
      • writer

        private final javax.ws.rs.ext.MessageBodyWriter<java.lang.Object> writer
        Deprecated.
    • Constructor Detail

      • SingletonProvider

        public SingletonProvider​(java.lang.Object jaxRsProvider,
                                 java.util.logging.Logger logger)
                          throws java.lang.IllegalArgumentException,
                                 javax.ws.rs.WebApplicationException
        Deprecated.
        Parameters:
        jaxRsProvider -
        logger - needed, if the provider implements no provider interface
        Throws:
        java.lang.IllegalArgumentException
        javax.ws.rs.WebApplicationException
    • Method Detail

      • getContextResolver

        public javax.ws.rs.ext.ContextResolver<?> getContextResolver()
        Deprecated.
        Description copied from interface: ContextResolver
        Returns the wrapped ContextResolver
        Specified by:
        getContextResolver in interface ContextResolver
        Returns:
        the contextResolver
      • getExcMapper

        public javax.ws.rs.ext.ExceptionMapper<? extends java.lang.Throwable> getExcMapper()
        Deprecated.
        Returns the ExceptionMapper, or null, if this provider is not an ExceptionMapper.
        Returns:
        the ExceptionMapper, or null, if this provider is not an ExceptionMapper.
      • getExcMapperType

        public java.lang.Class<?> getExcMapperType()
        Deprecated.
        Description copied from interface: ProviderWrapper
        Beispiele:
        • ExceptionMapper<IllegalArgumentException> -> IllegalArgumentException
        • MessageBodyReader<Integer> -> Integer
        Specified by:
        getExcMapperType in interface ProviderWrapper
        Returns:
        the type the wrapped exception mapper could map.
        See Also:
        ProviderWrapper.getExcMapperType()
      • getSize

        public long getSize​(java.lang.Object t,
                            java.lang.Class<?> type,
                            java.lang.reflect.Type genericType,
                            java.lang.annotation.Annotation[] annotations,
                            MediaType mediaType)
        Deprecated.
        Description copied from interface: MessageBodyWriter
        Called before writeTo to ascertain the length in bytes of the serialized form of t. A non-negative return value is used in a HTTP Content-Length header.
        Specified by:
        getSize in interface MessageBodyWriter
        Parameters:
        t - the instance to write
        mediaType - The Restlet MediaType
        Returns:
        length in bytes or -1 if the length cannot be determined in advance
        See Also:
        MessageBodyWriter.getSize(java.lang.Object, Class, Type, Annotation[], MediaType)
      • isContextResolver

        public final boolean isContextResolver()
        Deprecated.
        Returns true, if this ProviderWrapper is also a ContextResolver, otherwise false.
        Specified by:
        isContextResolver in interface ProviderWrapper
        Specified by:
        isContextResolver in class AbstractProviderWrapper
        Returns:
        true, if this ProviderWrapper is also a ContextResolver, otherwise false.
      • isReadable

        public boolean isReadable​(java.lang.Class<?> type,
                                  java.lang.reflect.Type genericType,
                                  java.lang.annotation.Annotation[] annotations,
                                  javax.ws.rs.core.MediaType mediaType)
        Deprecated.
        Checks, if this MessageBodyReader could read the given type.
        Specified by:
        isReadable in interface MessageBodyReader
        Parameters:
        type -
        genericType -
        annotations -
        Returns:
        true, if the wrapped message body reader supports reading for the given class with the given parameters.
        See Also:
        javax.ws.rs.ext.MessageBodyReader#isReadable(Class, Type, Annotation[])
      • isReader

        public final boolean isReader()
        Deprecated.
        Returns true, if this ProviderWrapper is also a MessageBodyReader, otherwise false.
        Specified by:
        isReader in interface ProviderWrapper
        Specified by:
        isReader in class AbstractProviderWrapper
        Returns:
        true, if this ProviderWrapper is also a MessageBodyReader, otherwise false.
      • isWriteable

        public boolean isWriteable​(java.lang.Class<?> type,
                                   java.lang.reflect.Type genericType,
                                   java.lang.annotation.Annotation[] annotations,
                                   javax.ws.rs.core.MediaType mediaType)
        Deprecated.
        Checks, if the given class could be written by this MessageBodyWriter.
        Specified by:
        isWriteable in interface MessageBodyWriter
        Parameters:
        type -
        genericType -
        annotations -
        mediaType - The JAX-RS MediaType
        Returns:
        true, if the wrapped message writer reader supports writing for the given class with the given parameters.
        See Also:
        javax.ws.rs.ext.MessageBodyWriter#isWriteable(Class)
      • isWriter

        public final boolean isWriter()
        Deprecated.
        Returns true, if this ProviderWrapper is also a MessageBodyWriter, otherwise false.
        Specified by:
        isWriter in interface ProviderWrapper
        Specified by:
        isWriter in class AbstractProviderWrapper
        Returns:
        true, if this ProviderWrapper is also a MessageBodyWriter, otherwise false.
      • readFrom

        public java.lang.Object readFrom​(java.lang.Class<?> type,
                                         java.lang.reflect.Type genericType,
                                         java.lang.annotation.Annotation[] annotations,
                                         MediaType mediaType,
                                         CharacterSet characterSet,
                                         javax.ws.rs.core.MultivaluedMap<java.lang.String,​java.lang.String> httpHeaders,
                                         java.io.InputStream entityStream)
                                  throws java.io.IOException,
                                         java.lang.reflect.InvocationTargetException
        Deprecated.
        Specified by:
        readFrom in interface MessageBodyReader
        Parameters:
        type -
        genericType - The generic Type to convert to.
        annotations - the annotations of the artifact to convert to
        mediaType -
        httpHeaders -
        entityStream -
        Returns:
        the read object
        Throws:
        java.io.IOException
        java.lang.reflect.InvocationTargetException
        See Also:
        javax.ws.rs.ext.MessageBodyReader#readFrom(Class, Type, javax.ws.rs.core.MediaType, Annotation[], MultivaluedMap, InputStream)
      • writeTo

        public void writeTo​(java.lang.Object object,
                            java.lang.Class<?> type,
                            java.lang.reflect.Type genericType,
                            java.lang.annotation.Annotation[] annotations,
                            MediaType mediaType,
                            javax.ws.rs.core.MultivaluedMap<java.lang.String,​java.lang.Object> httpHeaders,
                            java.io.OutputStream entityStream)
                     throws java.io.IOException
        Deprecated.
        Write a type to an HTTP response. The response header map is mutable but any changes must be made before writing to the output stream since the headers will be flushed prior to writing the response body.
        Specified by:
        writeTo in interface MessageBodyWriter
        Parameters:
        genericType - The generic Type to convert to.
        annotations - the annotations of the artifact to convert to
        mediaType - the media type of the HTTP entity.
        httpHeaders - a mutable map of the HTTP response headers.
        entityStream - the OutputStream for the HTTP entity.
        object - the object to write.
        Throws:
        java.io.IOException - if an IO error arises
        See Also:
        javax.ws.rs.ext.MessageBodyWriter#writeTo(Object, Type, Annotation[], javax.ws.rs.core.MediaType, MultivaluedMap, OutputStream)