public class SimpleHitWriter extends java.lang.Object implements ResultHitWriter
Modifier and Type | Field and Description |
---|---|
static long |
GIGA_BYTE |
static long |
KILO_BYTE |
static long |
MEGA_BYTE |
static long |
PETA_BYTE |
static long |
TERA_BYTE |
Constructor and Description |
---|
SimpleHitWriter() |
Modifier and Type | Method and Description |
---|---|
void |
write(Hit hit,
JSONWriter writer,
Query query)
Writes a given
Hit into the JSONWriter . |
static void |
writeSimpleJson(Hit hit,
JSONWriter writer) |
public static final long KILO_BYTE
public static final long MEGA_BYTE
public static final long GIGA_BYTE
public static final long TERA_BYTE
public static final long PETA_BYTE
public void write(Hit hit, JSONWriter writer, Query query) throws RepositoryException, JSONException
ResultHitWriter
Hit
into the JSONWriter
. This will be
called for each hit of the result page. The surrounding json structure is
an array and each entry should be a simple object. The caller will have
invoked the writer.object()
already and will call
writer.endObject()
directly after this method returns.write
in interface ResultHitWriter
hit
- the result hit to renderwriter
- to output jsonquery
- the original query; can be used to access custom parameters
set in the predicate root group (
query.getPredicates().get("param", "default")
)RepositoryException
- in case access on the hit failedJSONException
- in case there is a problem with writing to the jsonwriterpublic static void writeSimpleJson(Hit hit, JSONWriter writer) throws RepositoryException, JSONException
RepositoryException
JSONException
Copyright © 2010 - 2020 Adobe. All Rights Reserved