本文整理匯總了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());
}