Search in sources :

Example 1 with EntryWriter

use of org.apache.solr.common.MapWriter.EntryWriter in project lucene-solr by apache.

the class NaNFloatWriter method writeMap.

@Override
public void writeMap(MapWriter val) throws IOException {
    writeMapOpener(-1);
    incLevel();
    val.writeMap(new EntryWriter() {

        boolean isFirst = true;

        @Override
        public EntryWriter put(String k, Object v) throws IOException {
            if (isFirst) {
                isFirst = false;
            } else {
                JSONWriter.this.writeMapSeparator();
            }
            if (doIndent)
                JSONWriter.this.indent();
            JSONWriter.this.writeKey(k, true);
            JSONWriter.this.writeVal(k, v);
            return this;
        }
    });
    decLevel();
    writeMapCloser();
}
Also used : IOException(java.io.IOException) EntryWriter(org.apache.solr.common.MapWriter.EntryWriter)

Aggregations

IOException (java.io.IOException)1 EntryWriter (org.apache.solr.common.MapWriter.EntryWriter)1