本文整理汇总了Java中com.sun.org.apache.xpath.internal.compiler.Compiler.getFirstPredicateOpPos方法的典型用法代码示例。如果您正苦于以下问题:Java Compiler.getFirstPredicateOpPos方法的具体用法?Java Compiler.getFirstPredicateOpPos怎么用?Java Compiler.getFirstPredicateOpPos使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.sun.org.apache.xpath.internal.compiler.Compiler
的用法示例。
在下文中一共展示了Compiler.getFirstPredicateOpPos方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: initPredicateInfo
import com.sun.org.apache.xpath.internal.compiler.Compiler; //导入方法依赖的package包/类
/**
* Init predicate info.
*
* @param compiler The Compiler object that has information about this
* walker in the op map.
* @param opPos The op code position of this location step.
*
* @throws javax.xml.transform.TransformerException
*/
protected void initPredicateInfo(Compiler compiler, int opPos)
throws javax.xml.transform.TransformerException
{
int pos = compiler.getFirstPredicateOpPos(opPos);
if(pos > 0)
{
m_predicates = compiler.getCompiledPredicates(pos);
if(null != m_predicates)
{
for(int i = 0; i < m_predicates.length; i++)
{
m_predicates[i].exprSetParent(this);
}
}
}
}
示例2: analyzePredicate
import com.sun.org.apache.xpath.internal.compiler.Compiler; //导入方法依赖的package包/类
/**
* Analyze a step and give information about it's predicates. Right now this
* just returns true or false if the step has a predicate.
*
* @param compiler non-null reference to compiler object that has processed
* the XPath operations into an opcode map.
* @param opPos The opcode position for the step.
* @param stepType The type of step, one of OP_GROUP, etc.
*
* @return true if step has a predicate.
*
* @throws javax.xml.transform.TransformerException
*/
static boolean analyzePredicate(Compiler compiler, int opPos, int stepType)
throws javax.xml.transform.TransformerException
{
int argLen;
switch (stepType)
{
case OpCodes.OP_VARIABLE :
case OpCodes.OP_EXTFUNCTION :
case OpCodes.OP_FUNCTION :
case OpCodes.OP_GROUP :
argLen = compiler.getArgLength(opPos);
break;
default :
argLen = compiler.getArgLengthOfStep(opPos);
}
int pos = compiler.getFirstPredicateOpPos(opPos);
int nPredicates = compiler.countPredicates(pos);
return (nPredicates > 0) ? true : false;
}