public abstract class OutputSerializer extends Serializer
Modifier and Type | Field and Description |
---|---|
protected String |
encoding
Encoding.
|
protected byte[] |
itemsep
Item separator.
|
protected PrintOutput |
out
Output stream.
|
protected SerializerOptions |
sopts
Serializer options.
|
Modifier | Constructor and Description |
---|---|
protected |
OutputSerializer(OutputStream os,
SerializerOptions sopts)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
close()
Closes the serializer.
|
boolean |
finished()
Tests if the serialization was interrupted.
|
protected void |
indent()
Prints indentation whitespaces.
|
protected abstract void |
printChar(int cp)
Encodes and prints a character.
|
protected void |
printChars(byte[] text)
Encodes and prints characters.
|
protected void |
printHex(int cp)
Returns a hex entity for the specified codepoint.
|
void |
reset()
Resets the serializer (indentation, etc).
|
protected boolean |
separate()
Prints an item separator.
|
atomic, attribute, closeDoc, closeElement, comment, finishClose, finishEmpty, finishOpen, function, get, get, namespace, node, nsUri, openDoc, openElement, pi, sc, serialize, skipElement, startOpen, text, value
protected final PrintOutput out
protected final SerializerOptions sopts
protected final String encoding
protected byte[] itemsep
protected OutputSerializer(OutputStream os, SerializerOptions sopts) throws IOException
os
- output streamsopts
- serializer optionsIOException
- I/O exceptionpublic void reset()
Serializer
reset
in class Serializer
public final boolean finished()
Serializer
finished
in class Serializer
public void close() throws IOException
Serializer
close
in interface Closeable
close
in interface AutoCloseable
close
in class Serializer
IOException
- I/O exceptionprotected void indent() throws IOException
IOException
- I/O exceptionprotected boolean separate() throws IOException
IOException
- I/O exceptionprotected final void printChars(byte[] text) throws IOException
text
- characters to be printedIOException
- I/O exceptionprotected abstract void printChar(int cp) throws IOException
cp
- codepoint to be printedIOException
- I/O exceptionprotected final void printHex(int cp) throws IOException
cp
- codepointIOException
- I/O exceptionCopyright © 2005–2023 BaseX Team. All rights reserved.