| 构造器和说明 |
|---|
AbstractCodec()
Default constructor
|
| 限定符和类型 | 方法和说明 |
|---|---|
boolean |
containsCharacter(char c,
char[] array)
Utility to search a char[] for a specific char.
|
T |
decodeCharacter(PushbackSequence<T> input)
Returns the decoded version of the next character from the input string and
advances the current character in the PushbackSequence.
|
String |
encode(char[] immune,
String input)
WARNING!!
|
String |
encodeCharacter(char[] immune,
char c) |
String |
encodeCharacter(char[] immune,
Character c)
WARNING!!!!
|
String |
encodeCharacter(char[] immune,
int codePoint)
Default codepoint implementation that should be overridden in specific
codecs.
|
String |
getHexForNonAlphanumeric(char c)
Lookup the hex value of any character that is not alphanumeric.
|
String |
getHexForNonAlphanumeric(int c)
Lookup the hex value of any character that is not alphanumeric.
|
String |
toHex(char c) |
String |
toHex(int c) |
String |
toOctal(char c) |
public String encode(char[] immune, String input)
Character based Codecs will silently transform code points
that are not legal UTF code points into garbage data as they will cast them
to chars.
If you are implementing an Integer based codec, these will be
silently discarded based on the return from
Character.isValidCodePoint( int ). This is the preferred behavior
moving forward.
Encode a String so that it can be safely used in a specific context.public String encodeCharacter(char[] immune, Character c)
encodeCharacter 在接口中 Codec<T>immune - array of chars to NOT encode. Use with caution.c - the Character to encodemethod instead of this one!!! YOU HAVE
BEEN WARNED!!!!
{@inheritDoc}public String encodeCharacter(char[] immune, char c)
public String encodeCharacter(char[] immune, int codePoint)
CodecencodeCharacter 在接口中 Codec<T>codePoint - the integer to encodepublic T decodeCharacter(PushbackSequence<T> input)
CodecdecodeCharacter 在接口中 Codec<T>input - the Character to decodepublic String getHexForNonAlphanumeric(char c)
getHexForNonAlphanumeric 在接口中 Codec<T>c - The character to lookup.public String getHexForNonAlphanumeric(int c)
getHexForNonAlphanumeric 在接口中 Codec<T>c - The character to lookup.public boolean containsCharacter(char c,
char[] array)
containsCharacter 在接口中 Codec<T>Copyright © 2023. All rights reserved.