Package org.grails.encoder
Class DefaultEncodingStateRegistry
java.lang.Object
org.grails.encoder.DefaultEncodingStateRegistry
- All Implemented Interfaces:
EncodingStateRegistry
default implementation of
EncodingStateRegistry- Since:
- 2.3
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetEncodingStateFor(CharSequence string) Gets the current encoding state for a CharSequence.booleanisEncodedWith(Encoder encoder, CharSequence string) Checks if the CharSequence is encoded with encoder.static booleanisNoneEncoder(Encoder encoderToApply) static booleanisPreviousEncoderSafeOrEqual(Encoder encoderToApply, Encoder previousEncoder) Checks if is previous encoder is already "safe", equal or equivalentvoidregisterEncodedWith(Encoder encoder, CharSequence escaped) Registers that the CharSequence has been encoded with encoderbooleanshouldEncodeWith(Encoder encoderToApply, CharSequence string) Checks if a encoder should be applied to a CharSequencestatic booleanshouldEncodeWith(Encoder encoderToApply, EncodingState currentEncodingState) Checks if encoder should be applied to a input with given encoding state
-
Field Details
-
NONE_ENCODER
-
-
Constructor Details
-
DefaultEncodingStateRegistry
public DefaultEncodingStateRegistry()
-
-
Method Details
-
getEncodingStateFor
Description copied from interface:EncodingStateRegistryGets the current encoding state for a CharSequence.- Specified by:
getEncodingStateForin interfaceEncodingStateRegistry- Parameters:
string- a CharSequence- Returns:
- the encoding state for the CharSequence
-
isEncodedWith
Description copied from interface:EncodingStateRegistryChecks if the CharSequence is encoded with encoder.- Specified by:
isEncodedWithin interfaceEncodingStateRegistry- Parameters:
encoder- the encoderstring- a CharSequence- Returns:
- true, if it is encoded with encoder
-
registerEncodedWith
Description copied from interface:EncodingStateRegistryRegisters that the CharSequence has been encoded with encoder- Specified by:
registerEncodedWithin interfaceEncodingStateRegistry- Parameters:
encoder- the encoderescaped- the CharSequence
-
shouldEncodeWith
Description copied from interface:EncodingStateRegistryChecks if a encoder should be applied to a CharSequence- Specified by:
shouldEncodeWithin interfaceEncodingStateRegistry- Parameters:
encoderToApply- the encoder to applystring- a CharSequence- Returns:
- true, if it should be applied
-
shouldEncodeWith
Checks if encoder should be applied to a input with given encoding state- Parameters:
encoderToApply- the encoder to applycurrentEncodingState- the current encoding state- Returns:
- true, if should encode
-
isNoneEncoder
-
isPreviousEncoderSafeOrEqual
Checks if is previous encoder is already "safe", equal or equivalent- Parameters:
encoderToApply- the encoder to applypreviousEncoder- the previous encoder- Returns:
- true, if previous encoder is already "safe", equal or equivalent
-