Package org.grails.encoder
Interface Encoder
-
- All Superinterfaces:
CodecIdentifierProvider
- All Known Subinterfaces:
StreamingEncoder
- All Known Implementing Classes:
AbstractCharReplacementEncoder,BasicJSONEncoder,BasicXMLEncoder,ChainedEncoder,HTML4Encoder,HTMLEncoder,JavaScriptEncoder,NoneEncoder,RawCodec
public interface Encoder extends CodecIdentifierProvider
Interface for encoding methods.- Since:
- 2.3
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.lang.Objectencode(java.lang.Object o)Encode given input objectbooleanisApplyToSafelyEncoded()booleanisSafe()Checks if this encoder is XSS "safe".voidmarkEncoded(java.lang.CharSequence string)Mark this instance as encoded with this encoder in the currentEncodingStateRegistry-
Methods inherited from interface org.grails.encoder.CodecIdentifierProvider
getCodecIdentifier
-
-
-
-
Method Detail
-
encode
java.lang.Object encode(java.lang.Object o)
Encode given input object- Parameters:
o- the input object- Returns:
- the encoded object
-
isSafe
boolean isSafe()
Checks if this encoder is XSS "safe". This means that after appling this encoder, the characters have been escaped and are XSS safe to be included in HTML documents.- Returns:
- true, if is safe
-
isApplyToSafelyEncoded
boolean isApplyToSafelyEncoded()
- Returns:
trueif this this codec should be applied to a buffer part that is already encoded with a safe encoder
-
markEncoded
void markEncoded(java.lang.CharSequence string)
Mark this instance as encoded with this encoder in the currentEncodingStateRegistry- Parameters:
string- a CharSequence to mark as encoded
-
-