public abstract class StandardSerializer extends OutputSerializer
Modifier and Type | Field and Description |
---|---|
protected boolean |
atomic
Atomic flag.
|
protected Normalizer.Form |
form
Normalization form.
|
protected boolean |
sep
Include separator.
|
encoding, itemsep, out, sopts
Modifier | Constructor and Description |
---|---|
protected |
StandardSerializer(OutputStream os,
SerializerOptions sopts)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
protected void |
atomic(Item item)
Serializes an atomic value.
|
protected boolean |
characterMap(int cp)
Replaces a character with an entry from the character map.
|
protected void |
function(FItem item)
Serializes a function item.
|
protected void |
node(ANode node)
Serializes the specified node.
|
protected byte[] |
norm(byte[] text)
Normalizes the specified text.
|
protected void |
print(int cp)
Prints a single character.
|
protected void |
printChar(int cp)
Encodes and prints a character.
|
void |
reset()
Resets the serializer (indentation, etc).
|
void |
serialize(Item item)
Serializes the specified item, which may be a node or an atomic value.
|
close, finished, indent, printChars, printHex, separate
attribute, closeDoc, closeElement, comment, finishClose, finishEmpty, finishOpen, get, get, namespace, nsUri, openDoc, openElement, pi, sc, skipElement, startOpen, text, value
protected final Normalizer.Form form
protected boolean sep
protected boolean atomic
protected StandardSerializer(OutputStream os, SerializerOptions sopts) throws IOException
os
- output streamsopts
- serialization parametersIOException
- I/O exceptionpublic void serialize(Item item) throws IOException
Serializer
serialize
in class Serializer
item
- item to be serializedIOException
- I/O exceptionpublic void reset()
Serializer
reset
in class OutputSerializer
protected void node(ANode node) throws IOException
Serializer
node
in class Serializer
node
- node to be serializedIOException
- I/O exceptionprotected void function(FItem item) throws IOException
Serializer
function
in class Serializer
item
- itemIOException
- I/O exceptionprotected void atomic(Item item) throws IOException
Serializer
atomic
in class Serializer
item
- itemIOException
- I/O exceptionprotected final void printChar(int cp) throws IOException
OutputSerializer
printChar
in class OutputSerializer
cp
- codepoint to be printedIOException
- I/O exceptionprotected void print(int cp) throws IOException
cp
- codepointIOException
- I/O exceptionprotected final byte[] norm(byte[] text)
text
- text to be normalizedprotected final boolean characterMap(int cp) throws IOException
cp
- codepointtrue
if replacement was foundIOException
- I/O exceptionCopyright © 2005–2023 BaseX Team. All rights reserved.