-
- All Known Implementing Classes:
DeflateBodyDecoderFactory,GzipBodyDecoderFactory
- Enclosing interface:
- BodyDecoder<T>
public static interface BodyDecoder.FactoryA factory ofBodyDecoderinstances for some defined encoding.BodyDecoder.Factoryimplementations are registered as service-providers by means described in theServiceLoaderclass.
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description <T> BodyDecoder<T>create(java.net.http.HttpResponse.BodySubscriber<T> downstream)Creates aBodyDecoderwith the given downstream.<T> BodyDecoder<T>create(java.net.http.HttpResponse.BodySubscriber<T> downstream, java.util.concurrent.Executor executor)Creates aBodyDecoderwith the given downstream and executor.java.lang.Stringencoding()Returns the encoding used byBodyDecoderscreated by this factory.static java.util.Optional<BodyDecoder.Factory>getFactory(java.lang.String encoding)Returns the factory registered for the given encoding, if any.static java.util.Map<java.lang.String,BodyDecoder.Factory>installedBindings()Returns an immutable map that case-insensitively maps encodings to their corresponding registered factories.static java.util.List<BodyDecoder.Factory>installedFactories()Returns an immutable list of the registered factories.
-
-
-
Method Detail
-
encoding
java.lang.String encoding()
Returns the encoding used byBodyDecoderscreated by this factory.
-
create
<T> BodyDecoder<T> create(java.net.http.HttpResponse.BodySubscriber<T> downstream)
Creates aBodyDecoderwith the given downstream.
-
create
<T> BodyDecoder<T> create(java.net.http.HttpResponse.BodySubscriber<T> downstream, java.util.concurrent.Executor executor)
Creates aBodyDecoderwith the given downstream and executor.
-
installedFactories
static java.util.List<BodyDecoder.Factory> installedFactories()
Returns an immutable list of the registered factories.- Throws:
java.util.ServiceConfigurationError- if an error occurs while loading the registered factories
-
installedBindings
static java.util.Map<java.lang.String,BodyDecoder.Factory> installedBindings()
Returns an immutable map that case-insensitively maps encodings to their corresponding registered factories. If more than one factory is registered for a given encoding, it is unspecified which one ends up being in the map. However, decoders provided by this module are guaranteed to be overridden by ones registered by other modules for the same encoding.
-
getFactory
static java.util.Optional<BodyDecoder.Factory> getFactory(java.lang.String encoding)
Returns the factory registered for the given encoding, if any.
-
-