/** * Execute the function. The function must return * a valid object. * @param xctxt The current execution context. * @return A valid XObject. * * @throws javax.xml.transform.TransformerException */ public XObject execute(XPathContext xctxt) throws javax.xml.transform.TransformerException { return m_arg0.execute(xctxt).bool() ? XBoolean.S_TRUE : XBoolean.S_FALSE; }
/** * @see ExpressionOwner#setExpression(Expression) */ public void setExpression(Expression exp) { exp.exprSetParent(this); m_right = exp; }
/** This method tells the node to add its argument to the node's list of children. */ public void exprAddChild(ExpressionNode n, int i) { assertion(false, "exprAddChild method not implemented!"); }
XObject obj = expr.execute(xctxt); expr.executeCharsToContentHandler(xctxt, rth);
/** * Tell if this expression or it's subexpressions can traverse outside * the current subtree. * * @return true if traversal outside the context node's subtree can occur. */ public boolean canTraverseOutsideSubtree() { return m_arg0.canTraverseOutsideSubtree(); }
/** * @see Expression#deepEquals(Expression) */ public boolean deepEquals(Expression expr) { if(!isSameClass(expr)) return false; if(!m_left.deepEquals(((Operation)expr).m_left)) return false; if(!m_right.deepEquals(((Operation)expr).m_right)) return false; return true; } }
/** * Call the visitors for the function arguments. */ public void callArgVisitors(XPathVisitor visitor) { for (int i = 0; i < m_argVec.size(); i++) { Expression exp = (Expression)m_argVec.elementAt(i); exp.callVisitors(new ArgExtOwner(exp), visitor); } }
/** * Evaluate this operation directly to a boolean. * * @param xctxt The runtime execution context. * * @return The result of the operation as a boolean. * * @throws javax.xml.transform.TransformerException */ public boolean bool(XPathContext xctxt) throws javax.xml.transform.TransformerException { return m_right.bool(xctxt); }
/** * Execute the first argument expression that is expected to return a * nodeset. If the argument is null, then return the current context node. * * @param xctxt Runtime XPath context. * * @return The first node of the executed nodeset, or the current context * node if the first argument is null. * * @throws javax.xml.transform.TransformerException if an error occurs while * executing the argument expression. */ protected int getArg0AsNode(XPathContext xctxt) throws javax.xml.transform.TransformerException { return (null == m_arg0) ? xctxt.getCurrentNode() : m_arg0.asNode(xctxt); }
DTMIterator nl = m_functionExpr.asIterator(xctxt, context); XNumber score = SCORE_NONE;
expr.executeCharsToContentHandler(xctxt, rth);
XObject obj = expr.execute(xctxt); expr.executeCharsToContentHandler(xctxt, rth);
/** * Tell if this expression or it's subexpressions can traverse outside * the current subtree. * * @return true if traversal outside the context node's subtree can occur. */ public boolean canTraverseOutsideSubtree() { if (null != m_right && m_right.canTraverseOutsideSubtree()) return true; return false; }
/** * @see Expression#deepEquals(Expression) */ public boolean deepEquals(Expression expr) { if(!isSameClass(expr)) return false; if(!m_left.deepEquals(((Operation)expr).m_left)) return false; if(!m_right.deepEquals(((Operation)expr).m_right)) return false; return true; } }
/** * @see org.apache.xpath.XPathVisitable#callVisitors(ExpressionOwner, XPathVisitor) */ public void callVisitors(ExpressionOwner owner, XPathVisitor visitor) { if(visitor.visitUnaryOperation(owner, this)) { m_right.callVisitors(this, visitor); } }
/** * Evaluate this operation directly to a boolean. * * @param xctxt The runtime execution context. * * @return The result of the operation as a boolean. * * @throws javax.xml.transform.TransformerException */ public boolean bool(XPathContext xctxt) throws javax.xml.transform.TransformerException { return (m_left.bool(xctxt) || m_right.bool(xctxt)); }
/** * Execute the first argument expression that is expected to return a * nodeset. If the argument is null, then return the current context node. * * @param xctxt Runtime XPath context. * * @return The first node of the executed nodeset, or the current context * node if the first argument is null. * * @throws javax.xml.transform.TransformerException if an error occurs while * executing the argument expression. */ protected int getArg0AsNode(XPathContext xctxt) throws javax.xml.transform.TransformerException { return (null == m_arg0) ? xctxt.getCurrentNode() : m_arg0.asNode(xctxt); }
DTMIterator nl = m_functionExpr.asIterator(xctxt, context); XNumber score = SCORE_NONE;
expr.executeCharsToContentHandler(xctxt, rth);
/** * Execute the function. The function must return * a valid object. * @param xctxt The current execution context. * @return A valid XObject. * * @throws javax.xml.transform.TransformerException */ public XObject execute(XPathContext xctxt) throws javax.xml.transform.TransformerException { return m_arg0.execute(xctxt).bool() ? XBoolean.S_FALSE : XBoolean.S_TRUE; } }