Developing Processors
All processors implement the Processor interface, parameterized with the object they are designed to work with:public Response change(Response response);
If you extend an AbstractProcessor class then change() is automatically named by the process() method making it sufficient to implement the former.
twigkit.processor.AbstractProcessor<T>
Provides abstract implementations of init() and done() and handles setting parameters.
twigkit.search.processors.AbstractResultProcessor
Makes it easy to implement processors for Results by taking care of the iterations
public void processResult(int index, Result result) {…}
twigkit.search.processors.AbstractNamedFieldProcessor
Makes it easy to implement processors that target specific fields. Requires the
fields
parameter (use * for all fields). Only the named fields will be passed on to the process method.public void process(Field field) {…}
twigkit.search.processors.AbstractNamedFieldValueProcessor<T>
Use this abstract class to implement a Processor that will pass the named field values (where the value is an instance of T). Requires the fields parameter (use * for all fields). Validation of the field value being of the correct type is done by the abstract class.
public Value<String> processValue(Value<String> value) {…}
twigkit.search.processors.AbstractNamedFacetProcessor
Use this abstract class to implement Processor that will process specific named facets. Requires the facetNames parameter (use * for all facets).
public void processFacet(Facet facet) {…}
twigkit.search.processors.AbstractNamedFacetFiltersProcessor
Use this abstract class to process all the FacetFilters in the named facets. Requires the facetNames parameter (use * for all facets).
public void processFilter(FacetFilter filter) {…}