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
    • 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