public final class EncoderGroup extends Object
encoders
keyed by codings.
The getEncoderMatch(String)
and getEncoder(String)
methods are then used to find appropriate
encoders for specific Accept-Encoding
and Content-Encoding
header values.
Accept-Encoding
strings in the order they exist in this group.
Adding new entries will cause the entries to be prepended to the group. This allows for previous encoders to be overridden through subsequent calls.
For example, calling groupBuilder.append(E1.
will result in the order E3, E4, E1, E2
.
Constructor and Description |
---|
EncoderGroup(Encoder[] encoders)
Constructor
|
Modifier and Type | Method and Description |
---|---|
EncoderGroupBuilder |
builder()
Returns a builder that's a copy of the settings on this encoder group.
|
static EncoderGroupBuilder |
create()
Instantiates a new clean-slate
EncoderGroupBuilder object. |
Encoder |
getEncoder(String encoding)
Returns the encoder registered with the specified coding (e.g.
|
EncoderMatch |
getEncoderMatch(String acceptEncoding)
Returns the coding string for the matching encoder that can handle the specified
Accept-Encoding
or Content-Encoding header value. |
List<Encoder> |
getEncoders()
Returns the encoders in this group.
|
List<String> |
getSupportedEncodings()
Returns the set of codings supported by all encoders in this group.
|
public EncoderGroup(Encoder[] encoders)
encoders
- The encoders to add to this group.public static EncoderGroupBuilder create()
EncoderGroupBuilder
object.
This is equivalent to simply calling
.
EncoderGroupBuilder
object.public EncoderGroupBuilder builder()
EncoderGroupBuilder
initialized to this group.public EncoderMatch getEncoderMatch(String acceptEncoding)
Accept-Encoding
or Content-Encoding
header value.
Returns
This method is fully compliant with the RFC2616/14.3 and 14.11 specifications.
acceptEncoding
- The Accept-Encoding
or Content-Encoding
value.public Encoder getEncoder(String encoding)
encoding
- The coding string.public List<String> getSupportedEncodings()
public List<Encoder> getEncoders()
Copyright © 2018 Apache. All rights reserved.