Interface LineReader

  • All Known Implementing Classes:
    SimpleLineReader

    public interface LineReader
    When the Unmarshaller reads a text file, it reads it via a LineReader.
    Unless specified, the default implementation will be used, SimpleLineReader, which will read each line and pass it to the Unmarshaller
    Sometimes, text files contains lines you're not interested to, or you want to do some preprocessing before parsing them: in such cases, it's useful to provide your own implementation of LineReader
    See Also:
    SimpleLineReader
    • Method Detail

      • readLine

        String readLine​(Reader reader,
                        Padder defaultPadder,
                        String propertyDelimiter,
                        int recordLength,
                        String lineSeparator)
        Reads a line from a Reader. This is where you want to add your customization
        Parameters:
        reader - a reader, reading from a fixed-length file
        defaultPadder - the padder to optionally use when reading a line
        propertyDelimiter - the delimiter used to delimit properties on a line
        recordLength - the total expected length of a line
        lineSeparator - the character sequence used to mark the end of a line
        Returns:
        a string, or null if there are no more lines to read