public class XMLEncoder extends Encoder
Encoder.FixedCharArrayWriter
Modifier and Type | Field and Description |
---|---|
protected static char[] |
AMP_REF |
protected static char[] |
APOS_REF |
protected static char[] |
CHAR_REF_START |
protected static Encoder |
encoder |
protected static char[] |
GT_REF |
protected static char[] |
LT_REF |
protected static char[] |
QUOT_REF |
static Map |
XMLEntities |
Constructor and Description |
---|
XMLEncoder() |
Modifier and Type | Method and Description |
---|---|
int |
decode(char[] src,
int soff,
int len,
Writer dst)
Decodes from XML.
|
int |
decode(char[] src,
int soff,
int len,
Writer dst,
Map entities)
Decodes from XML.
|
int |
encode(char[] src,
int soff,
int len,
Writer dst)
Encodes to XML.
|
static Encoder |
encoder()
Returns the encoder instance.
|
protected static final char[] AMP_REF
protected static final char[] APOS_REF
protected static final char[] GT_REF
protected static final char[] LT_REF
protected static final char[] QUOT_REF
protected static final char[] CHAR_REF_START
protected static Encoder encoder
public static Map XMLEntities
public static Encoder encoder()
public int encode(char[] src, int soff, int len, Writer dst) throws IOException
encode
in class Encoder
src
- Char array to encode.soff
- Offset in the src array at which to begin reading.len
- Length of src array to encode.dst
- Writer in which to write the encoded chars.IOException
public int decode(char[] src, int soff, int len, Writer dst) throws IOException
decode
in class Encoder
src
- Char array to decode.soff
- Offset in the src array at which to begin reading.len
- Length of src array to decode.dst
- Writer in which to write the decoded chars.IOException
public int decode(char[] src, int soff, int len, Writer dst, Map entities) throws IOException
src
- Char array to decode.soff
- Offset in the src array at which to begin reading.len
- Length of src array to decode.dst
- Writer in which to write the decoded chars.entities
- Mapping of entity names to replacement texts.
If passed null, unrecognized entities will not be decoded.IOException