ExternalFn.java 文件源码

java
阅读 22 收藏 0 点赞 0 评论 0

项目:mulgara 作者:
/**
 * Look for a function in the registered XPathFunctionResolvers.
 * @param iri The URI of the function to find.
 * @return The requested XPathFunction, or <code>null</code> if not found.
 */
private XPathFunction findFunction(IRI iri, int argCount) {
  String label = iri.toString() + "/" + argCount;
  XPathFunction result = fnCache.get(label);
  if (result == null) {
    QName fnName = iri.getQName();
    if (fnName == null) return null;
    for (XPathFunctionResolver resolver: FunctionResolverRegistry.getFunctionResolverRegistry()) {
      try {
        result = resolver.resolveFunction(fnName, argCount);
        if (result != null) {
          fnCache.put(label, result);
          break;
        }
      } catch (Exception e) {
        // this resolver is unable to handle the given QName
        result = null;
      }
    }
  }
  return result;
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号