org.apache.xpath.Expression.execute()方法的使用及代码示例

x33g5p2x  于2022-01-19 转载在 其他  
字(7.2k)|赞(0)|评价(0)|浏览(158)

本文整理了Java中org.apache.xpath.Expression.execute()方法的一些代码示例,展示了Expression.execute()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Expression.execute()方法的具体详情如下:
包路径:org.apache.xpath.Expression
类名称:Expression
方法名:execute

Expression.execute介绍

[英]Execute an expression in the XPath runtime context, and return the result of the expression.
[中]

代码示例

代码示例来源:origin: robovm/robovm

/**
 * 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;
}

代码示例来源:origin: robovm/robovm

/**
  * 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;
 }
}

代码示例来源:origin: robovm/robovm

/**
 * Evaluate expression to a number.
 *
 *
 * @param xctxt The XPath runtime context.
 * @return The expression evaluated as a double.
 *
 * @throws javax.xml.transform.TransformerException
 */
public double num(XPathContext xctxt)
    throws javax.xml.transform.TransformerException
{
 return execute(xctxt).num();
}

代码示例来源:origin: xalan/xalan

/**
 * 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;
}

代码示例来源:origin: robovm/robovm

/**
 * Evaluate expression to a boolean.
 *
 *
 * @param xctxt The XPath runtime context.
 * @return false
 *
 * @throws javax.xml.transform.TransformerException
 */
public boolean bool(XPathContext xctxt)
    throws javax.xml.transform.TransformerException
{
 return execute(xctxt).bool();
}

代码示例来源:origin: robovm/robovm

/**
 * Cast result object to a string.
 *
 *
 * @param xctxt The XPath runtime context.
 * @return The string this wraps or the empty string if null
 *
 * @throws javax.xml.transform.TransformerException
 */
public XMLString xstr(XPathContext xctxt)
    throws javax.xml.transform.TransformerException
{
 return execute(xctxt).xstr();
}

代码示例来源:origin: xalan/xalan

/**
  * 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;
 }
}

代码示例来源:origin: robovm/robovm

/**
 * Execute the operand and apply the unary operation to the result.
 *
 *
 * @param xctxt The runtime execution context.
 *
 * @return An XObject that represents the result of applying the unary 
 *         operation to the evaluated operand.
 *
 * @throws javax.xml.transform.TransformerException
 */
public XObject execute(XPathContext xctxt) throws javax.xml.transform.TransformerException
{
 return operate(m_right.execute(xctxt));
}

代码示例来源:origin: xalan/xalan

/**
 * Evaluate expression to a boolean.
 *
 *
 * @param xctxt The XPath runtime context.
 * @return false
 *
 * @throws javax.xml.transform.TransformerException
 */
public boolean bool(XPathContext xctxt)
    throws javax.xml.transform.TransformerException
{
 return execute(xctxt).bool();
}

代码示例来源:origin: xalan/xalan

/**
 * Evaluate expression to a number.
 *
 *
 * @param xctxt The XPath runtime context.
 * @return The expression evaluated as a double.
 *
 * @throws javax.xml.transform.TransformerException
 */
public double num(XPathContext xctxt)
    throws javax.xml.transform.TransformerException
{
 return execute(xctxt).num();
}

代码示例来源:origin: xalan/xalan

/**
 * Cast result object to a string.
 *
 *
 * @param xctxt The XPath runtime context.
 * @return The string this wraps or the empty string if null
 *
 * @throws javax.xml.transform.TransformerException
 */
public XMLString xstr(XPathContext xctxt)
    throws javax.xml.transform.TransformerException
{
 return execute(xctxt).xstr();
}

代码示例来源:origin: robovm/robovm

/**
  * 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).xstr().startsWith(m_arg1.execute(xctxt).xstr())
      ? XBoolean.S_TRUE : XBoolean.S_FALSE;
 }
}

代码示例来源:origin: robovm/robovm

/**
  * 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 new XNumber(Math.ceil(m_arg0.execute(xctxt).num()));
 }
}

代码示例来源:origin: robovm/robovm

/**
  * 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 new XNumber(java.lang.Math.floor(m_arg0.execute(xctxt).num()));
 }
}

代码示例来源:origin: xalan/xalan

/**
  * 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).xstr().startsWith(m_arg1.execute(xctxt).xstr())
      ? XBoolean.S_TRUE : XBoolean.S_FALSE;
 }
}

代码示例来源:origin: xalan/xalan

/**
  * 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 new XNumber(java.lang.Math.floor(m_arg0.execute(xctxt).num()));
 }
}

代码示例来源:origin: xalan/xalan

/**
  * 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 new XNumber(Math.ceil(m_arg0.execute(xctxt).num()));
 }
}

代码示例来源:origin: robovm/robovm

/**
 * Return the first node out of the nodeset, if this expression is
 * a nodeset expression.
 * @param xctxt The XPath runtime context.
 * @return the first node out of the nodeset, or DTM.NULL.
 *
 * @throws javax.xml.transform.TransformerException
 */
public int asNode(XPathContext xctxt)
    throws javax.xml.transform.TransformerException
{
  DTMIterator iter = execute(xctxt).iter();
 return iter.nextNode();
}

代码示例来源:origin: xalan/xalan

/**
 * Return the first node out of the nodeset, if this expression is
 * a nodeset expression.
 * @param xctxt The XPath runtime context.
 * @return the first node out of the nodeset, or DTM.NULL.
 *
 * @throws javax.xml.transform.TransformerException
 */
public int asNode(XPathContext xctxt)
    throws javax.xml.transform.TransformerException
{
  DTMIterator iter = execute(xctxt).iter();
 return iter.nextNode();
}

代码示例来源:origin: robovm/robovm

/**
 * For support of literal objects in xpaths.
 *
 * @param xctxt The XPath execution context.
 *
 * @return This object.
 *
 * @throws javax.xml.transform.TransformerException
 */
public XObject execute(XPathContext xctxt) throws javax.xml.transform.TransformerException
{
  Expression expr = ((ElemVariable)m_obj).getSelect().getExpression();
 XObject xobj = expr.execute(xctxt);
 xobj.allowDetachToRelease(false);
 return xobj;
}

相关文章