Package org.supercsv.comment
Class CommentMatches
java.lang.Object
org.supercsv.comment.CommentMatches
- All Implemented Interfaces:
CommentMatcher
CommentMatcher that matches lines that match a specified regular expression.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionCommentMatches
(String regex) Constructs a new CommentMatches comment matcher. -
Method Summary
-
Field Details
-
pattern
-
-
Constructor Details
-
CommentMatches
Constructs a new CommentMatches comment matcher. Ensure that the regex is efficient (ideally matching start/end characters) as a complex regex can significantly slow down reading.- Parameters:
regex
- the regular expression a line must match to be a comment- Throws:
NullPointerException
- if regex is nullIllegalArgumentException
- if regex is emptyPatternSyntaxException
- if the regex is invalid
-
-
Method Details
-
isComment
Determines whether a line of CSV is a comment.- Specified by:
isComment
in interfaceCommentMatcher
- Parameters:
line
- the raw line of CSV- Returns:
- true if it's a comment, otherwise false
-