Search in sources :

Example 1 with IEntry

use of io.lacuna.bifurcan.IEntry in project exist by eXist-db.

the class AdaptiveWriter method writeMap.

private void writeMap(final AbstractMapType map) throws SAXException, XPathException, TransformerException {
    try {
        writer.write("map");
        addSpaceIfIndent();
        writer.write('{');
        addIndent();
        indent();
        for (final Iterator<IEntry<AtomicValue, Sequence>> i = map.iterator(); i.hasNext(); ) {
            final IEntry<AtomicValue, Sequence> entry = i.next();
            write(entry.key(), "", false);
            writer.write(':');
            addSpaceIfIndent();
            write(entry.value(), ",", true);
            if (i.hasNext()) {
                writer.write(',');
                indent();
            }
        }
        endIndent(null, null);
        indent();
        writer.write('}');
    } catch (IOException e) {
        throw new SAXException(e.getMessage());
    }
}
Also used : IEntry(io.lacuna.bifurcan.IEntry) IOException(java.io.IOException) SAXException(org.xml.sax.SAXException)

Aggregations

IEntry (io.lacuna.bifurcan.IEntry)1 IOException (java.io.IOException)1 SAXException (org.xml.sax.SAXException)1