Class ArrayValuesSourceParser<VS extends org.elasticsearch.search.aggregations.support.ValuesSource>
java.lang.Object
org.elasticsearch.search.aggregations.matrix.ArrayValuesSourceParser<VS>
- All Implemented Interfaces:
org.elasticsearch.search.aggregations.Aggregator.Parser
- Direct Known Subclasses:
ArrayValuesSourceParser.BytesValuesSourceParser
,ArrayValuesSourceParser.GeoPointValuesSourceParser
,ArrayValuesSourceParser.NumericValuesSourceParser
public abstract class ArrayValuesSourceParser<VS extends org.elasticsearch.search.aggregations.support.ValuesSource>
extends Object
implements org.elasticsearch.search.aggregations.Aggregator.Parser
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
static class
static class
-
Method Summary
Modifier and TypeMethodDescriptionprotected abstract ArrayValuesSourceAggregationBuilder<?>
createFactory
(String aggregationName, org.elasticsearch.search.aggregations.support.ValuesSourceType valuesSourceType, org.elasticsearch.search.aggregations.support.ValueType targetValueType, Map<org.elasticsearch.xcontent.ParseField, Object> otherOptions) Creates aValuesSourceAggregationBuilder
from the information gathered by the subclass.final ArrayValuesSourceAggregationBuilder<?>
protected abstract boolean
token
(String aggregationName, String currentFieldName, org.elasticsearch.xcontent.XContentParser.Token token, org.elasticsearch.xcontent.XContentParser parser, Map<org.elasticsearch.xcontent.ParseField, Object> otherOptions) Allows subclasses ofArrayValuesSourceParser
to parse extra parameters and store them in aMap
which will later be passed tocreateFactory(String, ValuesSourceType, ValueType, Map)
.
-
Method Details
-
parse
public final ArrayValuesSourceAggregationBuilder<?> parse(String aggregationName, org.elasticsearch.xcontent.XContentParser parser) throws IOException - Specified by:
parse
in interfaceorg.elasticsearch.search.aggregations.Aggregator.Parser
- Throws:
IOException
-
createFactory
protected abstract ArrayValuesSourceAggregationBuilder<?> createFactory(String aggregationName, org.elasticsearch.search.aggregations.support.ValuesSourceType valuesSourceType, org.elasticsearch.search.aggregations.support.ValueType targetValueType, Map<org.elasticsearch.xcontent.ParseField, Object> otherOptions) Creates aValuesSourceAggregationBuilder
from the information gathered by the subclass. Options parsed inArrayValuesSourceParser
itself will be added to the factory after it has been returned by this method.- Parameters:
aggregationName
- the name of the aggregationvaluesSourceType
- the type of theValuesSource
targetValueType
- the target type of the final value output by the aggregationotherOptions
- aMap
containing the extra options parsed by thetoken(String, String, XContentParser.Token, XContentParser, Map)
method- Returns:
- the created factory
-
token
protected abstract boolean token(String aggregationName, String currentFieldName, org.elasticsearch.xcontent.XContentParser.Token token, org.elasticsearch.xcontent.XContentParser parser, Map<org.elasticsearch.xcontent.ParseField, Object> otherOptions) throws IOExceptionAllows subclasses ofArrayValuesSourceParser
to parse extra parameters and store them in aMap
which will later be passed tocreateFactory(String, ValuesSourceType, ValueType, Map)
.- Parameters:
aggregationName
- the name of the aggregationcurrentFieldName
- the name of the current field being parsedtoken
- the current token for the parserparser
- the parserotherOptions
- aMap
of options to be populated by successive calls to this method which will then be passed to thecreateFactory(String, ValuesSourceType, ValueType, Map)
method- Returns:
true
if the current token was correctly parsed,false
otherwise- Throws:
IOException
- if an error occurs whilst parsing
-