Extracts a value from the given target object.
The method does not return any value since the extracted value may be collected by the ValueCollector#collect
method.
In order to return multiple results from a single extraction just invoke the ValueCollector#collect method
multiple times, so that the collector collects all results.
If the extraction is executed for an Object that implements a
Portable interface the target object
passed to the extractor is an instance of a
ValueReader enabling extraction from the Portable byte stream.
It sounds counter-intuitive, but a single extraction may return multiple values when arrays or collections are
involved.
Let's have a look at the following data structure:
class Motorbike {
Wheel wheel[2];
}
class Wheel {
String name;
}
Let's assume that we want to extract the names of all wheels from a single motorbike object. Each motorbike has
two wheels so there are two names too. In order to return both values from the extraction operation just collect
them separately using the ValueCollector. Collecting multiple values in such a way allows operating on these
multiple values as if they were single-values during the evaluation of the predicates.
Let's assume that we registered a custom extractor to under the name 'wheelName' and executed the following query:
'wheelName = front-wheel'.
The extraction may return up to two wheel names for each Motorbike since each Motorbike has up to two wheels.
In such a case, it is enough if a single value evaluates the predicate's condition to true to return a match, so
it will return a Motorbike if 'any' of the wheels matches the expression.