Package org.basex.io.serial.json
Class JsonSerializer
java.lang.Object
org.basex.io.serial.Serializer
org.basex.io.serial.OutputSerializer
org.basex.io.serial.StandardSerializer
org.basex.io.serial.json.JsonSerializer
- All Implemented Interfaces:
Closeable,AutoCloseable
- Direct Known Subclasses:
JsonBasicSerializer,JsonMLSerializer,JsonNodeSerializer
Abstract JSON serializer 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 -
Method Summary
Modifier and TypeMethodDescriptionprotected voidSerializes an atomic value.voidclose()Closes the serializer.voidSerializes a function item.protected final voidprint(int cp) Prints a single character.voidSerializes the specified item, which may be a node or an atomic value.protected final voidstring(byte[] string) Serializes a JSON string.Methods inherited from class org.basex.io.serial.StandardSerializer
characterMap, node, norm, printChar, resetMethods inherited from class org.basex.io.serial.OutputSerializer
finished, indent, printChars, printHex, separateMethods inherited from class org.basex.io.serial.Serializer
attribute, closeDoc, closeElement, comment, finishClose, finishEmpty, finishOpen, get, get, namespace, nsUri, openDoc, openElement, pi, sc, skipElement, startOpen, text, value
-
Method Details
-
serialize
Description copied from class:SerializerSerializes the specified item, which may be a node or an atomic value.- Overrides:
serializein classStandardSerializer- Parameters:
item- item to be serialized- Throws:
IOException- I/O exception
-
function
Description copied from class:SerializerSerializes a function item.- Overrides:
functionin classStandardSerializer- Parameters:
item- item- Throws:
IOException- I/O exception
-
atomic
Description copied from class:SerializerSerializes an atomic value.- Overrides:
atomicin classStandardSerializer- Parameters:
item- item- Throws:
IOException- I/O exception
-
string
Serializes a JSON string.- Parameters:
string- string- Throws:
IOException- I/O exception
-
print
Description copied from class:StandardSerializerPrints a single character.- Overrides:
printin classStandardSerializer- Parameters:
cp- codepoint- Throws:
IOException- I/O exception
-
close
Description copied from class:SerializerCloses the serializer.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classOutputSerializer- Throws:
IOException- I/O exception
-