本文整理汇总了Java中net.sf.saxon.pattern.NameTest.getPrimitiveType方法的典型用法代码示例。如果您正苦于以下问题:Java NameTest.getPrimitiveType方法的具体用法?Java NameTest.getPrimitiveType怎么用?Java NameTest.getPrimitiveType使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.sf.saxon.pattern.NameTest
的用法示例。
在下文中一共展示了NameTest.getPrimitiveType方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: DescendantAxisIterator
import net.sf.saxon.pattern.NameTest; //导入方法依赖的package包/类
public DescendantAxisIterator(NodeWrapper start, boolean includeSelf, boolean following, NodeTest test) {
this.start = start;
this.includeSelf = includeSelf;
this.following = following;
this.moveToNextSibling = following;
if (!following) anchor = start.node;
if (!includeSelf) currNode = start.node;
if (test == AnyNodeTest.getInstance()) { // performance hack
test = null; // mark as AnyNodeTest
}
else if (test instanceof NameTest) {
NameTest nt = (NameTest) test;
if (nt.getPrimitiveType() == Type.ELEMENT) { // performance hack
// mark as element name test
NamePool pool = getNamePool();
this.testLocalName = pool.getLocalName(nt.getFingerprint());
this.testURI = pool.getURI(nt.getFingerprint());
}
}
else if (test instanceof NodeKindTest) {
if (test.getPrimitiveType() == Type.ELEMENT) { // performance hack
// mark as element type test
this.testLocalName = "";
this.testURI = null;
}
}
this.nodeTest = test;
this.position = 0;
}
示例2: PrecedingAxisIterator
import net.sf.saxon.pattern.NameTest; //导入方法依赖的package包/类
public PrecedingAxisIterator(NodeWrapper start, boolean includeAncestors, NodeTest test) {
this.start = start;
this.includeAncestors = includeAncestors;
this.currNode = start.node;
if (includeAncestors)
nextAncestor = null;
else
nextAncestor = start.node.getParent();
if (test == AnyNodeTest.getInstance()) { // performance hack
test = null; // mark as AnyNodeTest
}
else if (test instanceof NameTest) {
NameTest nt = (NameTest) test;
if (nt.getPrimitiveType() == Type.ELEMENT) { // performance hack
// mark as element name test
NamePool pool = getNamePool();
this.testLocalName = pool.getLocalName(nt.getFingerprint());
this.testURI = pool.getURI(nt.getFingerprint());
}
}
else if (test instanceof NodeKindTest) {
if (test.getPrimitiveType() == Type.ELEMENT) { // performance hack
// mark as element type test
this.testLocalName = "";
this.testURI = null;
}
}
this.nodeTest = test;
this.position = 0;
}