本文整理汇总了Java中com.sun.org.apache.xpath.internal.Expression类的典型用法代码示例。如果您正苦于以下问题:Java Expression类的具体用法?Java Expression怎么用?Java Expression使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Expression类属于com.sun.org.apache.xpath.internal包,在下文中一共展示了Expression类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: deepEquals
import com.sun.org.apache.xpath.internal.Expression; //导入依赖的package包/类
/**
* @see Expression#deepEquals(Expression)
*/
public boolean deepEquals(Expression expr)
{
if (!super.deepEquals(expr))
return false;
PredicatedNodeTest pnt = (PredicatedNodeTest) expr;
if (null != m_predicates)
{
int n = m_predicates.length;
if ((null == pnt.m_predicates) || (pnt.m_predicates.length != n))
return false;
for (int i = 0; i < n; i++)
{
if (!m_predicates[i].deepEquals(pnt.m_predicates[i]))
return false;
}
}
else if (null != pnt.m_predicates)
return false;
return true;
}
示例2: setPredicateCount
import com.sun.org.apache.xpath.internal.Expression; //导入依赖的package包/类
/**
* Set the number of predicates that this walker has. This does more
* that one would think, as it creates a new predicate array of the
* size of the count argument, and copies count predicates into the new
* one from the old, and then reassigns the predicates value. All this
* to keep from having to have a predicate count value.
*
* @param count The number of predicates, which must be equal or less
* than the existing count.
*/
public void setPredicateCount(int count)
{
if(count > 0)
{
Expression[] newPredicates = new Expression[count];
for (int i = 0; i < count; i++)
{
newPredicates[i] = m_predicates[i];
}
m_predicates = newPredicates;
}
else
m_predicates = null;
}
示例3: getCompiledPredicates
import com.sun.org.apache.xpath.internal.Expression; //导入依赖的package包/类
/**
* Compile a zero or more predicates for a given match pattern.
*
* @param opPos The position of the first predicate the m_opMap array.
*
* @return reference to array of {@link com.sun.org.apache.xpath.internal.Expression} instances.
*
* @throws TransformerException if a error occurs creating the Expression.
*/
public Expression[] getCompiledPredicates(int opPos)
throws TransformerException
{
int count = countPredicates(opPos);
if (count > 0)
{
Expression[] predicates = new Expression[count];
compilePredicates(opPos, predicates);
return predicates;
}
return null;
}
示例4: deepEquals
import com.sun.org.apache.xpath.internal.Expression; //导入依赖的package包/类
/**
* @see Expression#deepEquals(Expression)
*/
public boolean deepEquals(Expression expr)
{
if(!super.deepEquals(expr))
return false;
if(null != m_arg1)
{
if(null == ((Function2Args)expr).m_arg1)
return false;
if(!m_arg1.deepEquals(((Function2Args)expr).m_arg1))
return false;
}
else if(null != ((Function2Args)expr).m_arg1)
return false;
return true;
}
示例5: fixupVariables
import com.sun.org.apache.xpath.internal.Expression; //导入依赖的package包/类
/**
* This function is used to fixup variables from QNames to stack frame
* indexes at stylesheet build time.
* @param vars List of QNames that correspond to variables. This list
* should be searched backwards for the first qualified name that
* corresponds to the variable reference qname. The position of the
* QName in the vector from the start of the vector will be its position
* in the stack frame (but variables above the globalsTop value will need
* to be offset to the current stack frame).
* NEEDSDOC @param globalsSize
*/
public void fixupVariables(java.util.Vector vars, int globalsSize)
{
if (null != m_argVec)
{
int nArgs = m_argVec.size();
for (int i = 0; i < nArgs; i++)
{
Expression arg = (Expression) m_argVec.elementAt(i);
arg.fixupVariables(vars, globalsSize);
}
}
}
示例6: addIterator
import com.sun.org.apache.xpath.internal.Expression; //导入依赖的package包/类
/**
* Add an iterator to the union list.
*
* @param expr non-null reference to a location path iterator.
*/
public void addIterator(DTMIterator expr)
{
// Increase array size by only 1 at a time. Fix this
// if it looks to be a problem.
if (null == m_iterators)
{
m_iterators = new DTMIterator[1];
m_iterators[0] = expr;
}
else
{
DTMIterator[] exprs = m_iterators;
int len = m_iterators.length;
m_iterators = new DTMIterator[len + 1];
System.arraycopy(exprs, 0, m_iterators, 0, len);
m_iterators[len] = expr;
}
expr.nextNode();
if(expr instanceof Expression)
((Expression)expr).exprSetParent(this);
}
示例7: setExpression
import com.sun.org.apache.xpath.internal.Expression; //导入依赖的package包/类
/**
* @see ExpressionOwner#setExpression(Expression)
*/
public void setExpression(Expression exp)
{
if(!(exp instanceof LocPathIterator))
{
// Yuck. Need FilterExprIter. Or make it so m_exprs can be just
// plain expressions?
WalkingIterator wi = new WalkingIterator(getPrefixResolver());
FilterExprWalker few = new FilterExprWalker(wi);
wi.setFirstWalker(few);
few.setInnerExpression(exp);
wi.exprSetParent(UnionPathIterator.this);
few.exprSetParent(wi);
exp.exprSetParent(few);
exp = wi;
}
else
exp.exprSetParent(UnionPathIterator.this);
m_exprs[m_index] = (LocPathIterator)exp;
}
示例8: deepEquals
import com.sun.org.apache.xpath.internal.Expression; //导入依赖的package包/类
/**
* @see Expression#deepEquals(Expression)
*/
public boolean deepEquals(Expression expr)
{
if(!super.deepEquals(expr))
return false;
if(null != m_arg0)
{
if(null == ((FunctionOneArg)expr).m_arg0)
return false;
if(!m_arg0.deepEquals(((FunctionOneArg)expr).m_arg0))
return false;
}
else if(null != ((FunctionOneArg)expr).m_arg0)
return false;
return true;
}
示例9: setArg
import com.sun.org.apache.xpath.internal.Expression; //导入依赖的package包/类
/**
* Set an argument expression for a function. This method is called by the
* XPath compiler.
*
* @param arg non-null expression that represents the argument.
* @param argNum The argument number index.
*
* @throws WrongNumberArgsException If the argNum parameter is greater than 1.
*/
public void setArg(Expression arg, int argNum)
throws WrongNumberArgsException
{
// System.out.println("argNum: "+argNum);
if (argNum == 0)
super.setArg(arg, argNum);
else if (1 == argNum)
{
m_arg1 = arg;
arg.exprSetParent(this);
}
else
reportWrongNumberArgs();
}
示例10: setArg
import com.sun.org.apache.xpath.internal.Expression; //导入依赖的package包/类
/**
* Set an argument expression for a function. This method is called by the
* XPath compiler.
*
* @param arg non-null expression that represents the argument.
* @param argNum The argument number index.
*
* @throws WrongNumberArgsException If the argNum parameter is greater than 0.
*/
public void setArg(Expression arg, int argNum)
throws WrongNumberArgsException
{
if (0 == argNum)
{
m_arg0 = arg;
arg.exprSetParent(this);
}
else
reportWrongNumberArgs();
}
示例11: setPredicates
import com.sun.org.apache.xpath.internal.Expression; //导入依赖的package包/类
/**
* Set the predicates for this match pattern step.
*
*
* @param predicates An array of expressions that define predicates
* for this step.
*/
public void setPredicates(Expression[] predicates)
{
m_predicates = predicates;
if(null != predicates)
{
for(int i = 0; i < predicates.length; i++)
{
predicates[i].exprSetParent(this);
}
}
calcScore();
}
示例12: compileUnary
import com.sun.org.apache.xpath.internal.Expression; //导入依赖的package包/类
/**
* Bottle-neck compilation of a unary operation.
*
* @param unary The parent unary operation.
* @param opPos The position in the op map of the parent operation.
*
* @return The unary argument.
*
* @throws TransformerException if syntax or other error occurs.
*/
private Expression compileUnary(UnaryOperation unary, int opPos)
throws TransformerException
{
int rightPos = getFirstChildPos(opPos);
unary.setRight(compile(rightPos));
return unary;
}
示例13: execute
import com.sun.org.apache.xpath.internal.Expression; //导入依赖的package包/类
/**
* For support of literal objects in xpaths.
*
* @param xctxt The XPath execution context.
*
* @return the result of executing the select expression
*
* @throws javax.xml.transform.TransformerException
*/
public XObject execute(XPathContext xctxt)
throws javax.xml.transform.TransformerException
{
XObject m_selected;
m_selected = ((Expression)m_obj).execute(xctxt);
m_selected.allowDetachToRelease(m_allowRelease);
if (m_selected.getType() == CLASS_STRING)
return m_selected;
else
return new XString(m_selected.str());
}
示例14: deepEquals
import com.sun.org.apache.xpath.internal.Expression; //导入依赖的package包/类
/**
* @see Expression#deepEquals(Expression)
*/
public boolean deepEquals(Expression expr)
{
if(!super.deepEquals(expr))
return false;
if(m_axis != ((OneStepIteratorForward)expr).m_axis)
return false;
return true;
}
示例15: deepEquals
import com.sun.org.apache.xpath.internal.Expression; //导入依赖的package包/类
/**
* @see Expression#deepEquals(Expression)
*/
public boolean deepEquals(Expression expr)
{
if(!isSameClass(expr))
return false;
NodeTest nt = (NodeTest)expr;
if(null != nt.m_name)
{
if(null == m_name)
return false;
else if(!nt.m_name.equals(m_name))
return false;
}
else if(null != m_name)
return false;
if(null != nt.m_namespace)
{
if(null == m_namespace)
return false;
else if(!nt.m_namespace.equals(m_namespace))
return false;
}
else if(null != m_namespace)
return false;
if(m_whatToShow != nt.m_whatToShow)
return false;
if(m_isTotallyWild != nt.m_isTotallyWild)
return false;
return true;
}