Interface InputParser<T>
-
- Type Parameters:
T- the type of data produced by parsing
- All Known Implementing Classes:
JsonInputParser,TextLineParser
public interface InputParser<T>Interfaces for generic named/indexed input parsers. Custom implementations must have a constructor with a single String argument, the character encoding name. If adequate, a parser may interpret a given field, e.g., if a JSON payload is given as string but the (field) access indicates that there shall be an object inside, the parser implementation may "deserialize" the string and look for the field. Implementing classes shall use their specific rather than generic return types forparse(byte[])andgetConverter()to reduce dependencies on<T>. Moreover, methods ofInputParser.ParseResultshall be directly used in combination withInputParser.InputConverterto avoid exposing<T>unless explicitly necessary. This interface is used to generate connector code against. Warning: This interface is not stable and may change during performance optimization.- Author:
- Holger Eichelberger, SSE
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interfaceInputParser.InputConverter<T>Converts parsed data to primitive types.static interfaceInputParser.ParseResult<T>Result of parsing data.
-
Field Summary
Fields Modifier and Type Field Description static charSEPARATORSeparator for hierarchical names.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description InputParser.InputConverter<T>getConverter()Returns a type converter for parsed data.InputParser.ParseResult<T>parse(byte[] data)Parses a chunk of data received from a source.
-
-
-
Field Detail
-
SEPARATOR
static final char SEPARATOR
Separator for hierarchical names.- See Also:
- Constant Field Values
-
-
Method Detail
-
parse
InputParser.ParseResult<T> parse(byte[] data) throws java.io.IOException
Parses a chunk of data received from a source.- Parameters:
data- the data- Returns:
- parsing result
- Throws:
java.io.IOException- if parsing fails for some reasons
-
getConverter
InputParser.InputConverter<T> getConverter()
Returns a type converter for parsed data.- Returns:
- the type converter
-
-