Class ArrayValuesSourceParser<VS extends org.elasticsearch.search.aggregations.support.ValuesSource>

java.lang.Object
org.elasticsearch.search.aggregations.support.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 java.lang.Object
implements org.elasticsearch.search.aggregations.Aggregator.Parser
  • Nested Class Summary

    Nested Classes
    Modifier and Type Class Description
    static class  ArrayValuesSourceParser.BytesValuesSourceParser  
    static class  ArrayValuesSourceParser.GeoPointValuesSourceParser  
    static class  ArrayValuesSourceParser.NumericValuesSourceParser  
  • Method Summary

    Modifier and Type Method Description
    protected abstract ArrayValuesSourceAggregationBuilder<?> createFactory​(java.lang.String aggregationName, org.elasticsearch.search.aggregations.support.ValuesSourceType valuesSourceType, org.elasticsearch.search.aggregations.support.ValueType targetValueType, java.util.Map<org.elasticsearch.common.ParseField,​java.lang.Object> otherOptions)
    Creates a ValuesSourceAggregationBuilder from the information gathered by the subclass.
    ArrayValuesSourceAggregationBuilder<?> parse​(java.lang.String aggregationName, org.elasticsearch.common.xcontent.XContentParser parser)  
    protected abstract boolean token​(java.lang.String aggregationName, java.lang.String currentFieldName, org.elasticsearch.common.xcontent.XContentParser.Token token, org.elasticsearch.common.xcontent.XContentParser parser, java.util.Map<org.elasticsearch.common.ParseField,​java.lang.Object> otherOptions)
    Allows subclasses of ArrayValuesSourceParser to parse extra parameters and store them in a Map which will later be passed to createFactory(String, ValuesSourceType, ValueType, Map).

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • parse

      public final ArrayValuesSourceAggregationBuilder<?> parse​(java.lang.String aggregationName, org.elasticsearch.common.xcontent.XContentParser parser) throws java.io.IOException
      Specified by:
      parse in interface org.elasticsearch.search.aggregations.Aggregator.Parser
      Throws:
      java.io.IOException
    • createFactory

      protected abstract ArrayValuesSourceAggregationBuilder<?> createFactory​(java.lang.String aggregationName, org.elasticsearch.search.aggregations.support.ValuesSourceType valuesSourceType, org.elasticsearch.search.aggregations.support.ValueType targetValueType, java.util.Map<org.elasticsearch.common.ParseField,​java.lang.Object> otherOptions)
      Creates a ValuesSourceAggregationBuilder from the information gathered by the subclass. Options parsed in ArrayValuesSourceParser itself will be added to the factory after it has been returned by this method.
      Parameters:
      aggregationName - the name of the aggregation
      valuesSourceType - the type of the ValuesSource
      targetValueType - the target type of the final value output by the aggregation
      otherOptions - a Map containing the extra options parsed by the token(String, String, XContentParser.Token, XContentParser, Map) method
      Returns:
      the created factory
    • token

      protected abstract boolean token​(java.lang.String aggregationName, java.lang.String currentFieldName, org.elasticsearch.common.xcontent.XContentParser.Token token, org.elasticsearch.common.xcontent.XContentParser parser, java.util.Map<org.elasticsearch.common.ParseField,​java.lang.Object> otherOptions) throws java.io.IOException
      Allows subclasses of ArrayValuesSourceParser to parse extra parameters and store them in a Map which will later be passed to createFactory(String, ValuesSourceType, ValueType, Map).
      Parameters:
      aggregationName - the name of the aggregation
      currentFieldName - the name of the current field being parsed
      token - the current token for the parser
      parser - the parser
      otherOptions - a Map of options to be populated by successive calls to this method which will then be passed to the createFactory(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