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 for
parse(byte[]) and
getConverter() to reduce dependencies on <T>. Moreover, methods of InputParser.ParseResult shall
be directly used in combination with InputParser.InputConverter to 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 ClassesModifier and TypeInterfaceDescriptionstatic interfaceConverts parsed data to primitive types.static interfaceResult of parsing data. -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionReturns a type converter for parsed data.parse(byte[] data) Parses a chunk of data received from a source.
-
Field Details
-
SEPARATOR
static final char SEPARATORSeparator for hierarchical names.- See Also:
-
-
Method Details
-
parse
Parses a chunk of data received from a source.- Parameters:
data- the data- Returns:
- parsing result
- Throws:
IOException- if parsing fails for some reasons
-
getConverter
InputParser.InputConverter<T> getConverter()Returns a type converter for parsed data.- Returns:
- the type converter
-