Interface RecordSeparatorPolicy

    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and TypeMethodDescription
      booleanisEndOfRecord​(java.lang.String record)
      Signal the end of a record based on the content of the current record.
      java.lang.StringpostProcess​(java.lang.String record)
      Give the policy a chance to post-process a complete record, e.g.
      java.lang.StringpreProcess​(java.lang.String record)
      Pre-process a record before another line is appended, in the case of a multi-line record.
    • Method Detail

      • isEndOfRecord

        boolean isEndOfRecord​(java.lang.String record)
        Signal the end of a record based on the content of the current record. During the course of processing, each time this method returns false, the next line read is appended onto it (building the record). The input is what you would expect from BufferedReader.readLine() - i.e. no line separator character at the end. But it might have line separators embedded in it.
        Parameters:
        record - a String without a newline character at the end.
        Returns:
        true if this line is a complete record.
      • postProcess

        java.lang.String postProcess​(java.lang.String record)
        Give the policy a chance to post-process a complete record, e.g. remove a suffix.
        Parameters:
        record - the complete record.
        Returns:
        a modified version of the record if desired.
      • preProcess

        java.lang.String preProcess​(java.lang.String record)
        Pre-process a record before another line is appended, in the case of a multi-line record. Can be used to remove a prefix or line-continuation marker. If a record is a single line this callback is not used (but postProcess(String) will be).
        Parameters:
        record - the current record.
        Returns:
        the line as it should be appended to a record.