public abstract class AbstractCharReplacementEncoder extends java.lang.Object implements Encoder, EncodesToWriter, StreamingEncoder
Abstract base class for implementing encoders that do character replacements Implements the StreamingEncoder interface that enables efficient streaming encoding
Modifiers | Name | Description |
---|---|---|
protected CodecIdentifier |
codecIdentifier |
Constructor and description |
---|
AbstractCharReplacementEncoder
(CodecIdentifier codecIdentifier) |
Type Params | Return Type | Name and description |
---|---|---|
|
protected java.lang.String |
convertToString(java.lang.Object o) |
|
public EncodesToWriter |
createChainingEncodesToWriter(java.util.List<StreamingEncoder> encoders, boolean applyAdditionalFirst) |
|
protected final java.lang.Object |
doCharReplacementEncoding(java.lang.Object o) |
|
public java.lang.Object |
encode(java.lang.Object o) |
|
public void |
encodeToStream(Encoder thisInstance, java.lang.CharSequence str, int off, int len, EncodedAppender appender, EncodingState encodingState) |
|
public void |
encodeToWriter(java.lang.CharSequence str, int off, int len, java.io.Writer writer, EncodingState encodingState) |
|
public void |
encodeToWriter(char[] buf, int off, int len, java.io.Writer writer, EncodingState encodingState) |
|
protected java.lang.Object |
escapeCharSequence(java.lang.CharSequence str) |
|
protected abstract java.lang.String |
escapeCharacter(char ch, char previousChar) Escape the character, return null if no replacement has to be made |
|
public CodecIdentifier |
getCodecIdentifier() |
|
public boolean |
isApplyToSafelyEncoded() |
|
public boolean |
isSafe() |
|
public void |
markEncoded(java.lang.CharSequence string) |
Methods inherited from class | Name |
---|---|
class java.lang.Object |
java.lang.Object#wait(long, int), java.lang.Object#wait(), java.lang.Object#wait(long), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll() |
Escape the character, return null if no replacement has to be made
ch
- the character to escapepreviousChar
- the previous char