net.sf.jsefa.common.lowlevel.filter
Class HeaderAndFooterFilter
java.lang.Object
net.sf.jsefa.common.lowlevel.filter.HeaderAndFooterFilter
- All Implemented Interfaces:
- LineFilter
public final class HeaderAndFooterFilter
- extends Object
- implements LineFilter
A filter for filtering out header and footer lines.
Instances of this class are immutable and thread-safe.
- Author:
- Norman Lahme-Huetig
|
Constructor Summary |
HeaderAndFooterFilter(int headerSize,
boolean hasFooter,
boolean storeFailedLines)
Constructs a new HeaderAndFooterFilter. |
|
Method Summary |
FilterResult |
filter(String line,
int lineNumber,
boolean truncated,
boolean lastLine)
Filters the given line. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
HeaderAndFooterFilter
public HeaderAndFooterFilter(int headerSize,
boolean hasFooter,
boolean storeFailedLines)
- Constructs a new
HeaderAndFooterFilter.
- Parameters:
headerSize - the size of the header to skip, i. e. number of lineshasFooter - true, if there is a footer to skip; false otherwisestoreFailedLines - true, if the lines which fail the filter should be stored; false otherwise
filter
public FilterResult filter(String line,
int lineNumber,
boolean truncated,
boolean lastLine)
- Filters the given line.
- Specified by:
filter in interface LineFilter
- Parameters:
line - the content of the linelineNumber - the number of the linetruncated - true, if the given content is incomplete, i. e. truncated at the end; false otherwise.lastLine - true, if it is the last line; false otherwise
- Returns:
- a Result
Copyright © 2014. All rights reserved.