Interface Parser<K,V>
-
- All Known Implementing Classes:
AbstractFlatTextFormatParser
,CSVParser
,DelimitedParser
,JavaScriptParser
,JSONPathParser
,JSONToLowerParser
,RegexParser
public interface Parser<K,V>
Class that can parse Strings into Maps. Not thread-safe.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Deprecated Methods Modifier and Type Method Description List<String>
getFieldNames()
Deprecated.Map<K,V>
parseToMap(String input)
Parse a String into a Map.void
setFieldNames(Iterable<String> fieldNames)
Deprecated.default void
startFileFromBeginning()
This method may or may not get called at the start of reading of every file depending on the type of IndexTasks.
-
-
-
Method Detail
-
startFileFromBeginning
default void startFileFromBeginning()
This method may or may not get called at the start of reading of every file depending on the type of IndexTasks. The parser state should be reset if exists.
-
parseToMap
@Nullable Map<K,V> parseToMap(String input)
Parse a String into a Map. The result can be null which means the given input string will be ignored.- Throws:
ParseException
- if the String cannot be parsed
-
setFieldNames
@Deprecated void setFieldNames(Iterable<String> fieldNames)
Deprecated.Set the fieldNames that you expect to see in parsed Maps. Deprecated; Parsers should not, in general, be expected to know what fields they will return. Some individual types of parsers do need to know (like a TSV parser) and those parsers have their own way of setting field names.
-
getFieldNames
@Deprecated List<String> getFieldNames()
Deprecated.Returns the fieldNames that we expect to see in parsed Maps, if known, or null otherwise. Deprecated; Parsers should not, in general, be expected to know what fields they will return.
-
-