org.springframework.batch.item.file.separator

## Class SuffixRecordSeparatorPolicy

- java.lang.Object
- - org.springframework.batch.item.file.separator.SimpleRecordSeparatorPolicy
  - - org.springframework.batch.item.file.separator.DefaultRecordSeparatorPolicy
    - - org.springframework.batch.item.file.separator.SuffixRecordSeparatorPolicy

- All Implemented Interfaces:
    RecordSeparatorPolicy

      public class SuffixRecordSeparatorPolicy
      extends DefaultRecordSeparatorPolicy

  A `RecordSeparatorPolicy` that looks for an exact match for a String at the end of a line (e.g. a semicolon).
  Author:
    Dave Syer

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static java.lang.String` | `DEFAULT_SUFFIX` Default value for record terminator suffix.

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `SuffixRecordSeparatorPolicy()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `isEndOfRecord(java.lang.String line)` Return true if the line ends with the specified substring.
    `java.lang.String` | `postProcess(java.lang.String record)` Remove the suffix from the end of the record.
    `void` | `setIgnoreWhitespace(boolean ignoreWhitespace)` Flag to indicate that the decision to terminate a record should ignore whitespace at the end of the line.
    `void` | `setSuffix(java.lang.String suffix)` Lines ending in this terminator String signal the end of a record.

    - ### Methods inherited from class org.springframework.batch.item.file.separator.DefaultRecordSeparatorPolicy

      `preProcess, setContinuation, setQuoteCharacter`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### DEFAULT_SUFFIX

          public static final java.lang.String DEFAULT_SUFFIX

      Default value for record terminator suffix.
      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### SuffixRecordSeparatorPolicy

          public SuffixRecordSeparatorPolicy()

  - ### Method Detail

    - #### setSuffix

          public void setSuffix(java.lang.String suffix)

      Lines ending in this terminator String signal the end of a record.
      Parameters:
        `suffix` - suffix to indicate the end of a record

    - #### setIgnoreWhitespace

          public void setIgnoreWhitespace(boolean ignoreWhitespace)

      Flag to indicate that the decision to terminate a record should ignore whitespace at the end of the line.
      Parameters:
        `ignoreWhitespace` - indicator

    - #### isEndOfRecord

          public boolean isEndOfRecord(java.lang.String line)

      Return true if the line ends with the specified substring. By default whitespace is trimmed before the comparison. Also returns true if the line is null, but not if it is empty.
      Specified by:
        `isEndOfRecord` in interface `RecordSeparatorPolicy`
      Overrides:
        `isEndOfRecord` in class `DefaultRecordSeparatorPolicy`
      Parameters:
        `line` - a String without a newline character at the end.
      Returns:
        true if this line is a complete record.
      See Also:
        `RecordSeparatorPolicy.isEndOfRecord(java.lang.String)`

    - #### postProcess

          public java.lang.String postProcess(java.lang.String record)

      Remove the suffix from the end of the record.
      Specified by:
        `postProcess` in interface `RecordSeparatorPolicy`
      Overrides:
        `postProcess` in class `SimpleRecordSeparatorPolicy`
      Parameters:
        `record` - the complete record.
      Returns:
        a modified version of the record if desired.
      See Also:
        `SimpleRecordSeparatorPolicy.postProcess(java.lang.String)`