Package org.basex.io.serial.json
Class JsonNodeSerializer
java.lang.Object
org.basex.io.serial.Serializer
org.basex.io.serial.OutputSerializer
org.basex.io.serial.StandardSerializer
org.basex.io.serial.json.JsonSerializer
org.basex.io.serial.json.JsonNodeSerializer
- All Implemented Interfaces:
Closeable,AutoCloseable
This class serializes items as JSON. The input must conform to the rules
defined in the
JsonDirectConverter and JsonAttsConverter class.- Author:
- BaseX Team 2005-21, BSD License, Christian Gruen
-
Field Summary
Fields inherited from class org.basex.io.serial.StandardSerializer
atomic, form, sepFields inherited from class org.basex.io.serial.OutputSerializer
encoding, itemsep, out, sopts -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidattribute(byte[] name, byte[] value, boolean standalone) Serializes an attribute.protected voidCloses an element.protected voidCloses an empty element.protected voidFinishes an opening element node.protected voidSerializes the specified node.protected voidStarts an element.protected voidSerializes a text.Methods inherited from class org.basex.io.serial.json.JsonSerializer
atomic, close, function, print, serialize, stringMethods inherited from class org.basex.io.serial.StandardSerializer
characterMap, norm, printChar, resetMethods inherited from class org.basex.io.serial.OutputSerializer
finished, indent, printChars, printHex, separateMethods inherited from class org.basex.io.serial.Serializer
closeDoc, closeElement, comment, get, get, namespace, nsUri, openDoc, openElement, pi, sc, skipElement, value
-
Constructor Details
-
JsonNodeSerializer
Constructor.- Parameters:
os- output streamopts- serialization parameters- Throws:
IOException- I/O exception
-
-
Method Details
-
node
Description copied from class:SerializerSerializes the specified node.- Overrides:
nodein classStandardSerializer- Parameters:
node- node to be serialized- Throws:
IOException- I/O exception
-
startOpen
Description copied from class:SerializerStarts an element.- Overrides:
startOpenin classSerializer- Parameters:
name- element name
-
attribute
Description copied from class:SerializerSerializes an attribute.- Overrides:
attributein classSerializer- Parameters:
name- namevalue- valuestandalone- standalone flag- Throws:
IOException- I/O exception
-
finishOpen
Description copied from class:SerializerFinishes an opening element node.- Overrides:
finishOpenin classSerializer- Throws:
IOException- I/O exception
-
text
Description copied from class:SerializerSerializes a text.- Overrides:
textin classSerializer- Parameters:
value- valueftp- full-text positions, used for visualization highlighting- Throws:
IOException- I/O exception
-
finishEmpty
Description copied from class:SerializerCloses an empty element.- Overrides:
finishEmptyin classSerializer- Throws:
IOException- I/O exception
-
finishClose
Description copied from class:SerializerCloses an element.- Overrides:
finishClosein classSerializer- Throws:
IOException- I/O exception
-