Class JSONSerializer
java.lang.Object
net.sf.saxon.event.SequenceReceiver
net.sf.saxon.event.SequenceWriter
net.sf.saxon.serialize.JSONSerializer
- All Implemented Interfaces:
Result, Receiver, ReceiverWithOutputProperties
This class implements the JSON serialization method defined in XSLT+XQuery Serialization 3.1.
- Author:
- Michael H. Kay
-
Field Summary
Fields inherited from class SequenceReceiver
pipelineConfiguration, previousAtomic, systemIdFields inherited from interface Result
PI_DISABLE_OUTPUT_ESCAPING, PI_ENABLE_OUTPUT_ESCAPING -
Constructor Summary
ConstructorsConstructorDescriptionJSONSerializer(PipelineConfiguration pipe, JSONEmitter emitter, Properties outputProperties) -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()End of the document.Get the output propertiesvoidSet the CharacterMap to be used, if anyvoidsetNormalizer(Normalizer normalizer) Set the Unicode normalizer to be used for normalizing strings.voidsetOutputProperties(Properties details) Set output propertiesvoidsetPropertySorter(Comparator<AtomicValue> sorter) voidAppend an arbitrary item (node or atomic value) to the outputMethods inherited from class SequenceWriter
append, characters, comment, endDocument, endElement, getTreeModel, processingInstruction, setTreeModel, setUnparsedEntity, startDocument, startElement, usesTypeAnnotationsMethods inherited from class SequenceReceiver
append, decompose, flatten, getConfiguration, getErrorCodeForDecomposingFunctionItems, getNamePool, getPipelineConfiguration, getSystemId, handlesAppend, open, setPipelineConfiguration, setSystemIdMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface Receiver
append, append, characters, comment, endDocument, endElement, getPipelineConfiguration, handlesAppend, open, processingInstruction, setPipelineConfiguration, setSystemId, setUnparsedEntity, startDocument, startElement, usesTypeAnnotationsMethods inherited from interface Result
getSystemId
-
Constructor Details
-
JSONSerializer
public JSONSerializer(PipelineConfiguration pipe, JSONEmitter emitter, Properties outputProperties) throws XPathException - Throws:
XPathException
-
-
Method Details
-
setOutputProperties
Set output properties- Parameters:
details- the output serialization properties
-
setPropertySorter
-
getOutputProperties
Get the output properties- Specified by:
getOutputPropertiesin interfaceReceiverWithOutputProperties- Returns:
- the properties that were set using setOutputProperties
-
setNormalizer
Set the Unicode normalizer to be used for normalizing strings.- Parameters:
normalizer- the normalizer to be used
-
setCharacterMap
Set the CharacterMap to be used, if any- Parameters:
map- the character map
-
write
Append an arbitrary item (node or atomic value) to the output- Specified by:
writein classSequenceWriter- Parameters:
item- the item to be appended- Throws:
XPathException- if the operation fails
-
close
End of the document.- Specified by:
closein interfaceReceiver- Overrides:
closein classSequenceWriter- Throws:
XPathException- if an error occurs
-