Class ArrayValuesSourceParser<VS extends ValuesSource>
- java.lang.Object
-
- org.elasticsearch.search.aggregations.support.ArrayValuesSourceParser<VS>
-
- All Implemented Interfaces:
Aggregator.Parser
- Direct Known Subclasses:
ArrayValuesSourceParser.AnyValuesSourceParser
,ArrayValuesSourceParser.BytesValuesSourceParser
,ArrayValuesSourceParser.GeoPointValuesSourceParser
,ArrayValuesSourceParser.NumericValuesSourceParser
public abstract class ArrayValuesSourceParser<VS extends ValuesSource> extends java.lang.Object implements Aggregator.Parser
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ArrayValuesSourceParser.AnyValuesSourceParser
static class
ArrayValuesSourceParser.BytesValuesSourceParser
static class
ArrayValuesSourceParser.GeoPointValuesSourceParser
static class
ArrayValuesSourceParser.NumericValuesSourceParser
-
Method Summary
Modifier and Type Method Description protected abstract ArrayValuesSourceAggregationBuilder<VS,?>
createFactory(java.lang.String aggregationName, ValuesSourceType valuesSourceType, ValueType targetValueType, java.util.Map<ParseField,java.lang.Object> otherOptions)
Creates aValuesSourceAggregationBuilder
from the information gathered by the subclass.ArrayValuesSourceAggregationBuilder<VS,?>
parse(java.lang.String aggregationName, XContentParser parser)
protected abstract boolean
token(java.lang.String aggregationName, java.lang.String currentFieldName, XContentParser.Token token, XContentParser parser, java.util.Map<ParseField,java.lang.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 Detail
-
parse
public final ArrayValuesSourceAggregationBuilder<VS,?> parse(java.lang.String aggregationName, XContentParser parser) throws java.io.IOException
- Specified by:
parse
in interfaceAggregator.Parser
- Throws:
java.io.IOException
-
createFactory
protected abstract ArrayValuesSourceAggregationBuilder<VS,?> createFactory(java.lang.String aggregationName, ValuesSourceType valuesSourceType, ValueType targetValueType, java.util.Map<ParseField,java.lang.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(java.lang.String aggregationName, java.lang.String currentFieldName, XContentParser.Token token, XContentParser parser, java.util.Map<ParseField,java.lang.Object> otherOptions) throws java.io.IOException
Allows 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:
java.io.IOException
- if an error occurs whilst parsing
-
-