Package org.apache.rat.header
Class HeaderMatcher
- java.lang.Object
-
- org.apache.rat.header.HeaderMatcher
-
public class HeaderMatcher extends java.lang.ObjectMatches headers.
Usage:
read(Reader)contentmatches(Pattern)against filtered content
Note: use only from a single thread.
-
-
Field Summary
Fields Modifier and Type Field Description private FilteringSequenceFactoryfactoryprivate HeaderBean[]headersprivate intlinesprivate java.lang.CharSequenceread
-
Constructor Summary
Constructors Constructor Description HeaderMatcher(CharFilter filter, int capacity)HeaderMatcher(CharFilter filter, int capacity, HeaderBean[] headers)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intlines()Number of lines read.booleanmatches(java.util.regex.Pattern pattern)Seeks a match in the last headers read.voidread(java.io.Reader reader)
-
-
-
Field Detail
-
factory
private final FilteringSequenceFactory factory
-
headers
private final HeaderBean[] headers
-
read
private java.lang.CharSequence read
-
lines
private int lines
-
-
Constructor Detail
-
HeaderMatcher
public HeaderMatcher(CharFilter filter, int capacity)
-
HeaderMatcher
public HeaderMatcher(CharFilter filter, int capacity, HeaderBean[] headers)
-
-
Method Detail
-
read
public void read(java.io.Reader reader) throws java.io.IOException- Throws:
java.io.IOException
-
matches
public boolean matches(java.util.regex.Pattern pattern)
Seeks a match in the last headers read.
Note that this pattern must not contain filtered characters.
- Parameters:
pattern-Patternto match- Returns:
- true if the pattern matches,
false otherwise or if
read(Reader)has not been called
-
lines
public int lines()
Number of lines read.- Returns:
- the number of lines in the file or -1 if the file has more lines than were read
-
-