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


Java NodeTest.matches方法代码示例

本文整理汇总了Java中net.sf.saxon.pattern.NodeTest.matches方法的典型用法代码示例。如果您正苦于以下问题:Java NodeTest.matches方法的具体用法?Java NodeTest.matches怎么用?Java NodeTest.matches使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在net.sf.saxon.pattern.NodeTest的用法示例。


在下文中一共展示了NodeTest.matches方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: startElement

import net.sf.saxon.pattern.NodeTest; //导入方法依赖的package包/类
@Override
public void startElement(NodeName elemName, SchemaType typeCode,
		int locationId, int properties) throws XPathException {
	MatchContext mc = matchContext.getLast();
	MatchContext newContext = new MatchContext();
	if (mc.elementArcs != null) {
		for (PathMapArc arc : mc.elementArcs) {
			NodeTest test = arc.getNodeTest();
			if (test == null || test.matches(Type.ELEMENT, elemName, typeCode.getFingerprint())) {
				newContext.bulidContext(arc.getTarget());
				newContext.matchedElement = true;
			} 
			if (arc.getAxis() == AxisInfo.DESCENDANT || arc.getAxis() == AxisInfo.DESCENDANT_OR_SELF) {
				newContext.processArc(arc);
			}
		}
	}
	matchContext.add(newContext);
	if (newContext.matchedElement) {
		super.startElement(elemName, typeCode, locationId, properties);
	} else if (logTrace) {
		LogManager.logTrace(LogConstants.CTX_RUNTIME, "Document projection did not match element", elemName.getURI(), ':', elemName.getLocalPart()); //$NON-NLS-1$
	}
}
 
开发者ID:kenweezy,项目名称:teiid,代码行数:25,代码来源:PathMapFilter.java

示例2: attribute

import net.sf.saxon.pattern.NodeTest; //导入方法依赖的package包/类
@Override
public void attribute(NodeName nameCode, SimpleType typeCode,
		CharSequence value, int locationId, int properties)
		throws XPathException {
	MatchContext mc = matchContext.getLast();
	if (!mc.matchedElement) {
		return;
	}
	if (nameCode.isInNamespace(javax.xml.XMLConstants.W3C_XML_SCHEMA_INSTANCE_NS_URI)) {
		super.attribute(nameCode, typeCode, value, locationId, properties);
		return;
	}
	if (mc.attributeArcs != null) {
		for (PathMapArc arc : mc.attributeArcs) {
			NodeTest test = arc.getNodeTest();
			if (test == null || test.matches(Type.ATTRIBUTE, nameCode, typeCode.getFingerprint())) {
				super.attribute(nameCode, typeCode, value, locationId, properties);
				return;
			} 
		}
	}
}
 
开发者ID:kenweezy,项目名称:teiid,代码行数:23,代码来源:PathMapFilter.java

示例3: filteredSingleton

import net.sf.saxon.pattern.NodeTest; //导入方法依赖的package包/类
private static AxisIterator filteredSingleton(NodeInfo node, NodeTest nodeTest) {
//    	return Navigator.filteredSingleton(node, nodeTest); // saxon >= 8.7
        if (node != null && (nodeTest == AnyNodeTest.getInstance() || nodeTest.matches(node))) {
            return SingleNodeIterator.makeIterator(node);
        } else {
            return EMPTY_AXIS_ITERATOR;
        }
    }
 
开发者ID:kenweezy,项目名称:teiid,代码行数:9,代码来源:NodeWrapper.java


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