本文整理汇总了Java中org.supercsv.comment.CommentMatcher类的典型用法代码示例。如果您正苦于以下问题:Java CommentMatcher类的具体用法?Java CommentMatcher怎么用?Java CommentMatcher使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
CommentMatcher类属于org.supercsv.comment包,在下文中一共展示了CommentMatcher类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: parse
import org.supercsv.comment.CommentMatcher; //导入依赖的package包/类
@Override
public SuperCsvParser parse (InputStream input) throws DatasetBuilderException {
return new SuperCsvParser (new CsvListReader (new InputStreamReader (input),
new Builder (quoteChar,
separatorChar,
endOfLineSymbols).skipComments (new CommentMatcher () {
@Override
public boolean isComment (String line) {
for (Pattern pattern : commentRegExpressions)
if (pattern.matcher (line).matches ())
return true;
return false;
}
}).build ()), rowIdParser);
}
示例2: skipComments
import org.supercsv.comment.CommentMatcher; //导入依赖的package包/类
/**
* Enables the skipping of comments. You can supply your own comment matcher or use one of the predefined ones:
* {@link org.supercsv.comment.CommentStartsWith CommentStartsWith} or
* {@link org.supercsv.comment.CommentMatches CommentMatches}
*
* @since 2.1.0
* @param commentMatcher
* the comment matcher to use
* @return the updated Builder
* @throws NullPointerException
* if commentMatcher is null
*/
public Builder skipComments(final CommentMatcher commentMatcher) {
if( commentMatcher == null ) {
throw new NullPointerException("commentMatcher should not be null");
}
this.commentMatcher = commentMatcher;
return this;
}
示例3: skipComments
import org.supercsv.comment.CommentMatcher; //导入依赖的package包/类
/**
* Sets the comment matcher.
*
* @param commentMatcher comment matcher
*/
public void skipComments(CommentMatcher commentMatcher) {
this.commentMatcher = commentMatcher;
}
示例4: getCommentMatcher
import org.supercsv.comment.CommentMatcher; //导入依赖的package包/类
/**
* Returns the comment matcher.
*
* @return the comment matcher
*/
public CommentMatcher getCommentMatcher() {
return commentMatcher;
}