当前位置: 首页>>代码示例>>Java>>正文


Java IdentifierMatcher类代码示例

本文整理汇总了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;
}
 
开发者ID:aitoralmeida,项目名称:c4a_data_repository,代码行数:21,代码来源:FilterParser.java

示例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));
}
 
开发者ID:aitoralmeida,项目名称:c4a_data_repository,代码行数:19,代码来源:FilterParser.java

示例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();
}
 
开发者ID:aitoralmeida,项目名称:c4a_data_repository,代码行数:18,代码来源:FilterParserTest.java

示例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);
}
 
开发者ID:aitoralmeida,项目名称:c4a_data_repository,代码行数:11,代码来源:FilterParser.java

示例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);
}
 
开发者ID:aitoralmeida,项目名称:c4a_data_repository,代码行数:15,代码来源:FilterParser.java

示例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);
}
 
开发者ID:aitoralmeida,项目名称:c4a_data_repository,代码行数:15,代码来源:FilterParser.java

示例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());
}
 
开发者ID:aitoralmeida,项目名称:c4a_data_repository,代码行数:9,代码来源:FilterParser.java


注:本文中的de.fuberlin.wiwiss.d2rq.mapgen.Filter.IdentifierMatcher类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。