本文整理汇总了Java中de.fuberlin.wiwiss.d2rq.mapgen.Filter.IdentifierMatcher类的典型用法代码示例。如果您正苦于以下问题:Java IdentifierMatcher类的具体用法?Java IdentifierMatcher怎么用?Java IdentifierMatcher使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
IdentifierMatcher类属于de.fuberlin.wiwiss.d2rq.mapgen.Filter包,在下文中一共展示了IdentifierMatcher类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: parse
import de.fuberlin.wiwiss.d2rq.mapgen.Filter.IdentifierMatcher; //导入依赖的package包/类
public List<List<IdentifierMatcher>> parse() throws ParseException {
eatSeparators();
while (!atEnd()) {
List<IdentifierMatcher> list = new ArrayList<IdentifierMatcher>();
while (!atEnd()) {
if (current() == '/') {
list.add(parseRegex());
} else {
list.add(parseIdentifier());
}
if (!atEnd() && atFilterTerminator()) {
break;
}
index++; // skip dot
}
result.add(list);
eatSeparators();
}
return result;
}
示例2: parseRegex
import de.fuberlin.wiwiss.d2rq.mapgen.Filter.IdentifierMatcher; //导入依赖的package包/类
private IdentifierMatcher parseRegex() throws ParseException {
StringBuilder builder = new StringBuilder();
index++; // skip initial '/'
while (!atEnd() && inRegex()) {
builder.append(current());
index++;
}
if (atEnd() || current() != '/') throw new ParseException("Unterminated regex: /" + builder.toString());
index++; // skip final '/'
int flags = 0;
while (!atEnd() && inFlags()) {
if (current() == 'i') {
flags |= Pattern.CASE_INSENSITIVE;
}
index++;
}
return Filter.createPatternMatcher(Pattern.compile(builder.toString(), flags));
}
示例3: toString
import de.fuberlin.wiwiss.d2rq.mapgen.Filter.IdentifierMatcher; //导入依赖的package包/类
private String toString(List<List<IdentifierMatcher>> filters) {
StringBuilder result = new StringBuilder();
for (List<IdentifierMatcher> l: filters) {
for (IdentifierMatcher m: l) {
result.append(m.toString());
result.append('.');
}
if (!l.isEmpty()) {
result.deleteCharAt(result.length() - 1);
}
result.append(',');
}
if (!filters.isEmpty()) {
result.deleteCharAt(result.length() - 1);
}
return result.toString();
}
示例4: parseSchemaFilter
import de.fuberlin.wiwiss.d2rq.mapgen.Filter.IdentifierMatcher; //导入依赖的package包/类
public Filter parseSchemaFilter() throws ParseException {
List<Filter> result = new ArrayList<Filter>();
for (List<IdentifierMatcher> list: parse()) {
if (list.size() != 1) {
throw new ParseException("Syntax error in schema filter list; expected list of comma- or newline-separated schema names: '" + s + "'");
}
result.add(new FilterMatchSchema(list.get(0)));
}
return FilterMatchAny.create(result);
}
示例5: parseTableFilter
import de.fuberlin.wiwiss.d2rq.mapgen.Filter.IdentifierMatcher; //导入依赖的package包/类
public Filter parseTableFilter(boolean matchParents) throws ParseException {
List<Filter> result = new ArrayList<Filter>();
for (List<IdentifierMatcher> list: parse()) {
if (list.size() < 1 || list.size() > 2) {
throw new ParseException("Syntax error in table filter list; expected list of comma- or newline-separated names in [schema.]table notation: '" + s + "'");
}
if (list.size() == 1) {
result.add(new FilterMatchTable(Filter.NULL_MATCHER, list.get(0), matchParents));
} else {
result.add(new FilterMatchTable(list.get(0), list.get(1), matchParents));
}
}
return FilterMatchAny.create(result);
}
示例6: parseColumnFilter
import de.fuberlin.wiwiss.d2rq.mapgen.Filter.IdentifierMatcher; //导入依赖的package包/类
public Filter parseColumnFilter(boolean matchParents) throws ParseException {
List<Filter> result = new ArrayList<Filter>();
for (List<IdentifierMatcher> list: parse()) {
if (list.size() < 2 || list.size() > 3) {
throw new ParseException("Syntax error in column filter list; expected list of comma- or newline-separated names in [schema.]table.column notation: '" + s + "'");
}
if (list.size() == 2) {
result.add(new FilterMatchColumn(Filter.NULL_MATCHER, list.get(0), list.get(1), matchParents));
} else {
result.add(new FilterMatchColumn(list.get(0), list.get(1), list.get(2), matchParents));
}
}
return FilterMatchAny.create(result);
}
示例7: parseIdentifier
import de.fuberlin.wiwiss.d2rq.mapgen.Filter.IdentifierMatcher; //导入依赖的package包/类
private IdentifierMatcher parseIdentifier() {
StringBuilder builder = new StringBuilder();
while (!atEnd() && inIdentifier()) {
builder.append(current());
index++;
}
return Filter.createStringMatcher(builder.toString().trim());
}