public final class DefaultEncodingStateRegistry extends java.lang.Object implements EncodingStateRegistry
EncodingStateRegistry| Modifier and Type | Field and Description |
|---|---|
static StreamingEncoder |
NONE_ENCODER |
| Constructor and Description |
|---|
DefaultEncodingStateRegistry() |
| Modifier and Type | Method and Description |
|---|---|
EncodingState |
getEncodingStateFor(java.lang.CharSequence string)
Gets the current encoding state for a CharSequence.
|
boolean |
isEncodedWith(Encoder encoder,
java.lang.CharSequence string)
Checks if the CharSequence is encoded with encoder.
|
static boolean |
isNoneEncoder(Encoder encoderToApply) |
static boolean |
isPreviousEncoderSafeOrEqual(Encoder encoderToApply,
Encoder previousEncoder)
Checks if is previous encoder is already "safe", equal or equivalent
|
void |
registerEncodedWith(Encoder encoder,
java.lang.CharSequence escaped)
Registers that the CharSequence has been encoded with encoder
|
boolean |
shouldEncodeWith(Encoder encoderToApply,
java.lang.CharSequence string)
Checks if a encoder should be applied to a CharSequence
|
static boolean |
shouldEncodeWith(Encoder encoderToApply,
EncodingState currentEncodingState)
Checks if encoder should be applied to a input with given encoding state
|
public static final StreamingEncoder NONE_ENCODER
public EncodingState getEncodingStateFor(java.lang.CharSequence string)
EncodingStateRegistrygetEncodingStateFor in interface EncodingStateRegistrystring - a CharSequencepublic boolean isEncodedWith(Encoder encoder, java.lang.CharSequence string)
EncodingStateRegistryisEncodedWith in interface EncodingStateRegistryencoder - the encoderstring - a CharSequencepublic void registerEncodedWith(Encoder encoder, java.lang.CharSequence escaped)
EncodingStateRegistryregisterEncodedWith in interface EncodingStateRegistryencoder - the encoderescaped - the CharSequencepublic boolean shouldEncodeWith(Encoder encoderToApply, java.lang.CharSequence string)
EncodingStateRegistryshouldEncodeWith in interface EncodingStateRegistryencoderToApply - the encoder to applystring - a CharSequencepublic static boolean shouldEncodeWith(Encoder encoderToApply, EncodingState currentEncodingState)
encoderToApply - the encoder to applycurrentEncodingState - the current encoding statepublic static boolean isNoneEncoder(Encoder encoderToApply)
public static boolean isPreviousEncoderSafeOrEqual(Encoder encoderToApply, Encoder previousEncoder)
encoderToApply - the encoder to applypreviousEncoder - the previous encoder