public abstract class StandardSerializer extends OutputSerializer
Modifier and Type | Field and Description |
---|---|
protected boolean |
atomic
Atomic flag.
|
protected Normalizer.Form |
form
Normalization form.
|
protected IntObjMap<byte[]> |
map
WebDAV flag.
|
protected boolean |
sep
Include separator.
|
itemsep, out, sopts
Modifier | Constructor and Description |
---|---|
protected |
StandardSerializer(PrintOutput out,
SerializerOptions sopts)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
protected void |
atomic(Item item)
Serializes an atomic value.
|
protected void |
encode(int cp)
Encodes the specified codepoint before printing it.
|
protected void |
function(FItem item)
Serializes a function item.
|
protected void |
node(ANode item)
Serializes the specified node.
|
protected byte[] |
norm(byte[] text)
Normalizes the specified text.
|
protected void |
printChar(int cp)
Writes a codepoint in the current encoding and
converts newlines to the operating system's default.
|
protected void |
printChars(byte[] token)
Prints the characters of the specified token.
|
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, itemsep, newline
attribute, closeDoc, closeElement, comment, finishClose, finishEmpty, finishOpen, get, get, ignore, namespace, nsUri, openDoc, openElement, pi, startOpen, text
protected final Normalizer.Form form
protected final IntObjMap<byte[]> map
protected boolean sep
protected boolean atomic
protected StandardSerializer(PrintOutput out, SerializerOptions sopts) throws IOException
out
- print outputsopts
- 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 item) throws IOException
Serializer
node
in class Serializer
item
- 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 byte[] norm(byte[] text)
text
- text to be normalizedprotected void printChars(byte[] token) throws IOException
token
- tokenIOException
- I/O exceptionprotected final void printChar(int cp) throws IOException
cp
- codepoint to be printedIOException
- I/O exceptionprotected void encode(int cp) throws IOException
cp
- codepoint to be encoded and printedIOException
- I/O exceptionCopyright © 2005–2015 BaseX Team. All rights reserved.