org.jaxen.expr.XPathExpr.getRootExpr()方法的使用及代码示例

x33g5p2x  于2022-02-03 转载在 其他  
字(4.4k)|赞(0)|评价(0)|浏览(120)

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

XPathExpr.getRootExpr介绍

[英]Returns the wrapped expression object.
[中]返回包装的表达式对象。

代码示例

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

/** Retrieve the root expression of the internal
 *  compiled form of this XPath expression.
 *
 *  <p>
 *  Internally, Jaxen maintains a form of Abstract Syntax
 *  Tree (AST) to represent the structure of the XPath expression.
 *  This is normally not required during normal consumer-grade
 *  usage of Jaxen.  This method is provided for hard-core users
 *  who wish to manipulate or inspect a tree-based version of
 *  the expression.
 *  </p>
 *
 *  @return the root of the AST of this expression
 */
public Expr getRootExpr() 
{
  return xpath.getRootExpr();
}

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

public static Pattern parse(String text) throws JaxenException, org.jaxen.saxpath.SAXPathException
{
  if ( USE_HANDLER )
  {
    XPathReader reader = XPathReaderFactory.createReader();
    PatternHandler handler = new PatternHandler();       
    
    handler.setXPathFactory( new DefaultXPathFactory() );            
    reader.setXPathHandler( handler );
    reader.parse( text );
    
    return handler.getPattern();
  }
  else
  {
    XPathReader reader = XPathReaderFactory.createReader();
    JaxenHandler handler = new JaxenHandler();
    
    handler.setXPathFactory( new DefaultXPathFactory() );            
    reader.setXPathHandler( handler );
    reader.parse( text );
    Pattern pattern = convertExpr( handler.getXPathExpr().getRootExpr() );
    return pattern.simplify();
  }
}

代码示例来源:origin: org.dhatim/milyn-smooks-core

Expr expr = xpath.getRootExpr();
if (!(expr instanceof LocationPath)) {
  throw new SAXPathException("Invalid XPath expression '" + xpathExpression + "'.  Selector must be a LocationPath expression. Is '" + expr.getText() + "'.");

代码示例来源:origin: org.milyn/milyn-smooks-core

Expr expr = xpath.getRootExpr();
if (!(expr instanceof LocationPath)) {
  throw new SAXPathException("Invalid XPath expression '" + xpathExpression + "'.  Selector must be a LocationPath expression. Is '" + expr.getText() + "'.");

代码示例来源:origin: org.milyn/milyn-smooks-all

Expr expr = xpath.getRootExpr();
if (!(expr instanceof LocationPath)) {
  throw new SAXPathException("Invalid XPath expression '" + xpathExpression + "'.  Selector must be a LocationPath expression. Is '" + expr.getText() + "'.");

代码示例来源:origin: org.virtuslab/milyn-smooks-core

Expr expr = xpath.getRootExpr();
if (!(expr instanceof LocationPath)) {
  throw new SAXPathException("Invalid XPath expression '" + xpathExpression + "'.  Selector must be a LocationPath expression. Is '" + expr.getText() + "'.");

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

Expr expr = xpath.getRootExpr();
if (!(expr instanceof LocationPath)) {
  throw new SAXPathException("Invalid XPath expression '" + xpathExpression + "'.  Selector must be a LocationPath expression. Is '" + expr.getText() + "'.");

代码示例来源:origin: org.opendaylight.yangtools/yang-data-jaxen

static @NonNull JaxenXPath create(final @NonNull Converter<String, QNameModule> converter,
    final @NonNull SchemaPath schemaPath, final @NonNull String xpath) throws JaxenException {
  final @NonNull Expr parsed;
  try {
    final XPathReader reader = new org.jaxen.saxpath.base.XPathReader();
    final JaxenHandler handler = new JaxenHandler();
    reader.setXPathHandler(handler);
    reader.parse(xpath);
    parsed = handler.getXPathExpr().getRootExpr();
  } catch (org.jaxen.saxpath.XPathSyntaxException e) {
    throw new XPathSyntaxException(e);
  } catch (SAXPathException e) {
    throw new JaxenException(e);
  }
  LOG.debug("Compiled {} to expression {}", xpath, parsed);
  new ExprWalker(new ExprListener() {
    // FIXME: perform expression introspection to understand things like apex, etc.
  }).walk(parsed);
  return new JaxenXPath(converter, schemaPath, parsed);
}

代码示例来源:origin: opendaylight/yangtools

static @NonNull JaxenXPath create(final @NonNull Converter<String, QNameModule> converter,
    final @NonNull SchemaPath schemaPath, final @NonNull String xpath) throws JaxenException {
  final @NonNull Expr parsed;
  try {
    final XPathReader reader = new org.jaxen.saxpath.base.XPathReader();
    final JaxenHandler handler = new JaxenHandler();
    reader.setXPathHandler(handler);
    reader.parse(xpath);
    parsed = handler.getXPathExpr().getRootExpr();
  } catch (org.jaxen.saxpath.XPathSyntaxException e) {
    throw new XPathSyntaxException(e);
  } catch (SAXPathException e) {
    throw new JaxenException(e);
  }
  LOG.debug("Compiled {} to expression {}", xpath, parsed);
  new ExprWalker(new ExprListener() {
    // FIXME: perform expression introspection to understand things like apex, etc.
  }).walk(parsed);
  return new JaxenXPath(converter, schemaPath, parsed);
}

相关文章

XPathExpr类方法