use of org.exist.util.serializer.json.JSONSerializer in project exist by eXist-db.
the class XQuerySerializer method serializeJSON.
private void serializeJSON(final Sequence sequence, final long compilationTime, final long executionTime) throws SAXException, XPathException {
// it should be transformed to JSON following the rules of the old JSON writer
if (sequence.hasOne() && Type.subTypeOf(sequence.getItemType(), Type.ELEMENT)) {
serializeXML(sequence, 1, sequence.getItemCount(), false, false, compilationTime, executionTime);
} else {
JSONSerializer serializer = new JSONSerializer(broker, outputProperties);
serializer.serialize(sequence, writer);
}
}
Aggregations