Package com.day.cq.search.writer
Class SelectivePropHitWriter
- java.lang.Object
-
- com.day.cq.search.writer.SelectivePropHitWriter
-
- All Implemented Interfaces:
ResultHitWriter
public class SelectivePropHitWriter extends java.lang.Object implements ResultHitWriter
SelectivePropHitWriter writes selective node properties. To write selective property of child nodes,specify relative path of property.
-
-
Constructor Summary
Constructors Constructor Description SelectivePropHitWriter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidwrite(Hit hit, JSONWriter writer, Query query)Writes a givenHitinto theJSONWriter.
-
-
-
Method Detail
-
write
public void write(Hit hit, JSONWriter writer, Query query) throws javax.jcr.RepositoryException, JSONException
Description copied from interface:ResultHitWriterWrites a givenHitinto theJSONWriter. 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 thewriter.object()already and will callwriter.endObject()directly after this method returns.- Specified by:
writein interfaceResultHitWriter- Parameters:
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"))- Throws:
javax.jcr.RepositoryException- in case access on the hit failedJSONException- in case there is a problem with writing to the jsonwriter
-
-