public class JavaScriptEncoder extends AbstractCharReplacementEncoder
Used for making strings safe to be included in a SCRIPT tag besides normal Javascript escaping, possibly "unsafe" characters are escaped too so that it's safe to include an escaped string in a HTML SCRIPT tag.
Modifiers | Name | Description |
---|---|---|
static CodecIdentifier |
JAVASCRIPT_CODEC_IDENTIFIER |
Fields inherited from class | Fields |
---|---|
class AbstractCharReplacementEncoder |
codecIdentifier |
Constructor and description |
---|
JavaScriptEncoder
() |
Type Params | Return Type | Name and description |
---|---|---|
|
protected java.lang.String |
escapeCharacter(char ch, char previousChar) |
|
public boolean |
isApplyToSafelyEncoded() |
|
public boolean |
isEquivalent(CodecIdentifier other) |
Methods inherited from class | Name |
---|---|
class AbstractCharReplacementEncoder |
convertToString, createChainingEncodesToWriter, doCharReplacementEncoding, encode, encodeToStream, encodeToWriter, encodeToWriter, escapeCharSequence, escapeCharacter, getCodecIdentifier, isApplyToSafelyEncoded, isSafe, markEncoded |