Package org.elasticsearch.index.mapper
Class AbstractGeometryFieldMapper.Parser<Parsed>
java.lang.Object
org.elasticsearch.index.mapper.AbstractGeometryFieldMapper.Parser<Parsed>
- Direct Known Subclasses:
AbstractPointGeometryFieldMapper.PointParser
,GeoShapeParser
- Enclosing class:
- AbstractGeometryFieldMapper<Parsed,Processed>
public abstract static class AbstractGeometryFieldMapper.Parser<Parsed>
extends java.lang.Object
Interface representing parser in geometry indexing pipeline.
-
Constructor Summary
Constructors Constructor Description Parser()
-
Method Summary
Modifier and Type Method Description abstract java.lang.Object
format(Parsed value, java.lang.String format)
Given a parsed value and a format string, formats the value into a plain Java object.abstract Parsed
parse(org.elasticsearch.common.xcontent.XContentParser parser)
Parse the given xContent value to an object of typeAbstractGeometryFieldMapper.Parser
.java.lang.Object
parseAndFormatObject(java.lang.Object value, java.lang.String format)
Parses the given value, then formats it according to the 'format' string.
-
Constructor Details
-
Parser
public Parser()
-
-
Method Details
-
parse
public abstract Parsed parse(org.elasticsearch.common.xcontent.XContentParser parser) throws java.io.IOException, java.text.ParseExceptionParse the given xContent value to an object of typeAbstractGeometryFieldMapper.Parser
. The value can be in any supported format.- Throws:
java.io.IOException
java.text.ParseException
-
format
Given a parsed value and a format string, formats the value into a plain Java object. Supported formats include 'geojson' and 'wkt'. The different formats are defined as subclasses ofGeometryFormat
. -
parseAndFormatObject
public java.lang.Object parseAndFormatObject(java.lang.Object value, java.lang.String format)Parses the given value, then formats it according to the 'format' string. By default, this method simply parses the value usingparse(org.elasticsearch.common.xcontent.XContentParser)
, then formats it withformat(Parsed, java.lang.String)
. However someAbstractGeometryFieldMapper.Parser
implementations override this as they can avoid parsing the value if it is already in the right format.
-