gpt4 book ai didi

net.sf.saxon.expr.XPathContextMajor.setCurrentException()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-20 18:35:40 25 4
gpt4 key购买 nike

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

XPathContextMajor.setCurrentException介绍

[英]Set the current exception (in saxon:catch)
[中]设置当前异常(在saxon中为catch)

代码示例

代码示例来源:origin: net.sf.saxon/Saxon-HE

/**
 * Evaluate as a singleton item
 *
 * @param c the dynamic XPath evaluation context
 */
public Item evaluateItem(XPathContext c) throws XPathException {
  XPathContext c1 = c.newMinorContext();
  try {
    return ExpressionTool.eagerEvaluate(tryOp.getChildExpression(), c1).head();
  } catch (XPathException err) {
    if (err.isGlobalError()) {
      err.setIsGlobalError(false);
    } else {
      StructuredQName code = err.getErrorCodeQName();
      if(code == null) {
        code = new StructuredQName("err", NamespaceConstant.SAXON,"SXWN9000");
      }
      for (CatchClause clause : catchClauses) {
        if (clause.nameTest.matches(code)) {
          Expression caught = clause.catchOp.getChildExpression();
          XPathContextMajor c2 = c.newContext();
          c2.setCurrentException(err);
          return caught.evaluateItem(c2);
        }
      }
    }
    err.setHasBeenReported(false);
    throw err;
  }
}

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.saxon

/**
 * Evaluate as a singleton item
 *
 * @param c the dynamic XPath evaluation context
 */
public Item evaluateItem(XPathContext c) throws XPathException {
  XPathContext c1 = c.newMinorContext();
  try {
    return ExpressionTool.eagerEvaluate(tryOp.getChildExpression(), c1).head();
  } catch (XPathException err) {
    if (err.isGlobalError()) {
      err.setIsGlobalError(false);
    } else {
      StructuredQName code = err.getErrorCodeQName();
      if(code == null) {
        code = new StructuredQName("err", NamespaceConstant.SAXON,"SXWN9000");
      }
      for (CatchClause clause : catchClauses) {
        if (clause.nameTest.matches(code)) {
          Expression caught = clause.catchOp.getChildExpression();
          XPathContextMajor c2 = c.newContext();
          c2.setCurrentException(err);
          return caught.evaluateItem(c2);
        }
      }
    }
    err.setHasBeenReported(false);
    throw err;
  }
}

代码示例来源:origin: net.sf.saxon/Saxon-HE

Expression caught = clause.catchOp.getChildExpression();
XPathContextMajor c2 = c.newContext();
c2.setCurrentException(err);

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.saxon

Expression caught = clause.catchOp.getChildExpression();
XPathContextMajor c2 = c.newContext();
c2.setCurrentException(err);

代码示例来源:origin: net.sf.saxon/Saxon-HE

c2.setCurrentException(err);

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.saxon

c2.setCurrentException(err);

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com