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 classArrayValuesSourceParser.AnyValuesSourceParserstatic classArrayValuesSourceParser.BytesValuesSourceParserstatic classArrayValuesSourceParser.GeoPointValuesSourceParserstatic classArrayValuesSourceParser.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 aValuesSourceAggregationBuilderfrom the information gathered by the subclass.ArrayValuesSourceAggregationBuilder<VS,?>parse(java.lang.String aggregationName, XContentParser parser)protected abstract booleantoken(java.lang.String aggregationName, java.lang.String currentFieldName, XContentParser.Token token, XContentParser parser, java.util.Map<ParseField,java.lang.Object> otherOptions)Allows subclasses ofArrayValuesSourceParserto parse extra parameters and store them in aMapwhich will later be passed tocreateFactory(String, ValuesSourceType, ValueType, Map).
-
Method Details
-
parse
public final ArrayValuesSourceAggregationBuilder<VS,?> parse(java.lang.String aggregationName, XContentParser parser) throws java.io.IOException- Specified by:
parsein 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 aValuesSourceAggregationBuilderfrom the information gathered by the subclass. Options parsed inArrayValuesSourceParseritself will be added to the factory after it has been returned by this method.- Parameters:
aggregationName- the name of the aggregationvaluesSourceType- the type of theValuesSourcetargetValueType- the target type of the final value output by the aggregationotherOptions- aMapcontaining 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.IOExceptionAllows subclasses ofArrayValuesSourceParserto parse extra parameters and store them in aMapwhich 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- aMapof options to be populated by successive calls to this method which will then be passed to thecreateFactory(String, ValuesSourceType, ValueType, Map)method- Returns:
trueif the current token was correctly parsed,falseotherwise- Throws:
java.io.IOException- if an error occurs whilst parsing
-