Package com.caucho.xpath

Examples of com.caucho.xpath.XPathFun


  /**
   */
  private void fillChildren(Env env, Tree tree, Node childNode, String base)
    throws Exception
  {
    XPathFun docShouldDisplay = env == null ? null : env.getFunction("doc-should-display");

    for (; childNode != null; childNode = childNode.getNextSibling()) {
      if (! childNode.getNodeName().equals("item"))
        continue;

      if (docShouldDisplay != null && !Expr.toBoolean(docShouldDisplay.eval(childNode,env,null,null)))
        continue;

      Element elt = (Element) childNode;

      NavItem item = new NavItem();
View Full Code Here


  /**
   */
  private void fillChildren(Env env, Tree tree, Node childNode, String base)
    throws Exception
  {
    XPathFun docShouldDisplay = env == null ? null : env.getFunction("doc-should-display");

    for (; childNode != null; childNode = childNode.getNextSibling()) {
      if (! childNode.getNodeName().equals("item"))
  continue;

      if (docShouldDisplay != null && !Expr.toBoolean(docShouldDisplay.eval(childNode,env,null,null)))
        continue;

      Element elt = (Element) childNode;

      NavItem item = new NavItem();
View Full Code Here

  /**
   */
  private void fillChildren(Env env, Tree tree, Node childNode, String base)
    throws Exception
  {
    XPathFun docShouldDisplay = env == null ? null : env.getFunction("doc-should-display");

    for (; childNode != null; childNode = childNode.getNextSibling()) {
      if (! childNode.getNodeName().equals("item"))
  continue;

      if (docShouldDisplay != null && !Expr.toBoolean(docShouldDisplay.eval(childNode,env,null,null)))
        continue;

      Element elt = (Element) childNode;

      NavItem item = new NavItem();
View Full Code Here

  }

  public Object evalObject(Node node, ExprEnvironment env)
    throws XPathException
  {
    XPathFun fun = env.getFunction(_name);
   
    // XXX: need to propagate the exception
    if (fun == null)
      throw new RuntimeException("unknown function: " + _name);

    ArrayList<Object> values = new ArrayList<Object>();
    for (int i = 0; i < _args.size(); i++) {
      Expr expr = _args.get(i);
      values.add(expr.evalObject(node, env));
    }

    return fun.eval(node, env, _pattern, values);
  }
View Full Code Here

  }

  public Object evalObject(Node node, ExprEnvironment env)
    throws XPathException
  {
    XPathFun fun = env.getFunction(_name);
   
    // XXX: need to propagate the exception
    if (fun == null)
      throw new RuntimeException("unknown function: " + _name);

    ArrayList<Object> values = new ArrayList<Object>();
    for (int i = 0; i < _args.size(); i++) {
      Expr expr = _args.get(i);
      values.add(expr.evalObject(node, env));
    }

    return fun.eval(node, env, _pattern, values);
  }
View Full Code Here

TOP

Related Classes of com.caucho.xpath.XPathFun

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.