gpt4 book ai didi

net.sf.saxon.query.XQueryFunction.getNumberOfArguments()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-25 07:11:05 26 4
gpt4 key购买 nike

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

XQueryFunction.getNumberOfArguments介绍

[英]Get the arity of the function
[中]得到函数的算术性

代码示例

代码示例来源:origin: net.sourceforge.saxon/saxon

/**
 * Check that all the types used in the signature of an imported function
 * are available in the module of the caller of the function
 * @param fd the declaration of the imported function
 * @throws XPathException if an error is found
 */
public void checkImportedFunctionSignature(XQueryFunction fd) throws XPathException {
  checkImportedType(fd.getResultType(), fd);
  for (int a=0; a<fd.getNumberOfArguments(); a++) {
    SequenceType argType = fd.getArgumentTypes()[a];
    checkImportedType(argType, fd);
  }
}

代码示例来源:origin: org.opengis.cite.saxon/saxon9

/**
 * Check that all the types used in the signature of an imported function
 * are available in the module of the caller of the function
 * @param fd the declaration of the imported function
 * @throws XPathException if an error is found
 */
public void checkImportedFunctionSignature(XQueryFunction fd) throws XPathException {
  checkImportedType(fd.getResultType(), fd);
  for (int a=0; a<fd.getNumberOfArguments(); a++) {
    SequenceType argType = fd.getArgumentTypes()[a];
    checkImportedType(argType, fd);
  }
}

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

} else if (referees.get(i + 1) instanceof XQueryFunction) {
  XQueryFunction next = (XQueryFunction) referees.get(i + 1);
  messageBuilder.append(" calls ").append(next.getFunctionName().getDisplayName()).append("#").append(next.getNumberOfArguments()).append("()");

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

} else if (referees.get(i + 1) instanceof XQueryFunction) {
  XQueryFunction next = (XQueryFunction) referees.get(i + 1);
  messageBuilder.append(" calls ").append(next.getFunctionName().getDisplayName()).append("#").append(next.getNumberOfArguments()).append("()");

代码示例来源:origin: net.sourceforge.saxon/saxon

XQueryFunction next = (XQueryFunction)referees.get(i + 1);
message += " calls " + next.getFunctionName().getDisplayName() +
    "#" + next.getNumberOfArguments() + "()";

代码示例来源:origin: org.opengis.cite.saxon/saxon9

XQueryFunction next = (XQueryFunction)referees.get(i + 1);
message += " calls " + next.getFunctionName().getDisplayName() +
    "#" + next.getNumberOfArguments() + "()";

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

/**
 * Produce diagnostic output showing the compiled and optimized expression tree for a function
 *
 * @param out the destination to be used
 */
public void explain(/*@NotNull*/ ExpressionPresenter out) throws XPathException {
  out.startElement("declareFunction");
  out.emitAttribute("name", functionName.getDisplayName());
  out.emitAttribute("arity", "" + getNumberOfArguments());
  if (compiledFunction == null) {
    out.emitAttribute("unreferenced", "true");
  } else {
    if (compiledFunction.isMemoFunction()) {
      out.emitAttribute("memo", "true");
    }
    out.emitAttribute("tailRecursive", compiledFunction.isTailRecursive() ? "true" : "false");
    body.export(out);
  }
  out.endElement();
}

代码示例来源:origin: net.sourceforge.saxon/saxon

/**
 * Produce diagnostic output showing the compiled and optimized expression tree for a function
 * @param out the destination to be used
 */
public void explain(ExpressionPresenter out) {
  out.startElement("declareFunction");
  out.emitAttribute("name", functionName.getDisplayName());
  out.emitAttribute("arity", ""+getNumberOfArguments());
  if (compiledFunction == null) {
    out.emitAttribute("unreferenced", "true");
  } else {
    if (compiledFunction.isMemoFunction()) {
      out.emitAttribute("memo", "true");
    }
    out.emitAttribute("tailRecursive", (compiledFunction.isTailRecursive() ? "true" : "false"));
    body.explain(out);
  }
  out.endElement();
}

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

/**
 * Produce diagnostic output showing the compiled and optimized expression tree for a function
 *
 * @param out the destination to be used
 */
public void explain(/*@NotNull*/ ExpressionPresenter out) throws XPathException {
  out.startElement("declareFunction");
  out.emitAttribute("name", functionName.getDisplayName());
  out.emitAttribute("arity", "" + getNumberOfArguments());
  if (compiledFunction == null) {
    out.emitAttribute("unreferenced", "true");
  } else {
    if (compiledFunction.isMemoFunction()) {
      out.emitAttribute("memo", "true");
    }
    out.emitAttribute("tailRecursive", compiledFunction.isTailRecursive() ? "true" : "false");
    body.export(out);
  }
  out.endElement();
}

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

/**
 * Register a user-defined XQuery function.
 * <p>This method is intended for internal use only.</p>
 *
 * @param function the function being declared
 * @throws net.sf.saxon.trans.XPathException
 *          if an error occurs, for example
 *          a duplicate function name
 */
public void declareFunction(/*@NotNull*/ XQueryFunction function) throws XPathException {
  Configuration config = getConfiguration();
  if (function.getNumberOfArguments() == 1) {
    StructuredQName name = function.getFunctionName();
    SchemaType t = config.getSchemaType(name);
    if (t != null && t.isAtomicType()) {
      XPathException err = new XPathException("Function name " + function.getDisplayName() +
          " clashes with the name of the constructor function for an atomic type");
      err.setErrorCode("XQST0034");
      err.setIsStaticError(true);
      throw err;
    }
  }
  XQueryFunctionLibrary local = getLocalFunctionLibrary();
  local.declareFunction(function);
  //if (!function.isPrivate()) {
  QueryModule main = getTopLevelModule();
  main.globalFunctionLibrary.declareFunction(function);
  //}
}

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

/**
 * Register a user-defined XQuery function.
 * <p>This method is intended for internal use only.</p>
 *
 * @param function the function being declared
 * @throws net.sf.saxon.trans.XPathException
 *          if an error occurs, for example
 *          a duplicate function name
 */
public void declareFunction(/*@NotNull*/ XQueryFunction function) throws XPathException {
  Configuration config = getConfiguration();
  if (function.getNumberOfArguments() == 1) {
    StructuredQName name = function.getFunctionName();
    SchemaType t = config.getSchemaType(name);
    if (t != null && t.isAtomicType()) {
      XPathException err = new XPathException("Function name " + function.getDisplayName() +
          " clashes with the name of the constructor function for an atomic type");
      err.setErrorCode("XQST0034");
      err.setIsStaticError(true);
      throw err;
    }
  }
  XQueryFunctionLibrary local = getLocalFunctionLibrary();
  local.declareFunction(function);
  //if (!function.isPrivate()) {
  QueryModule main = getTopLevelModule();
  main.globalFunctionLibrary.declareFunction(function);
  //}
}

代码示例来源:origin: net.sourceforge.saxon/saxon

/**
 * Register a user-defined XQuery function.
 * <p/>
 * This method is intended for internal use only.
 * @param function the function being declared
 */
public void declareFunction(XQueryFunction function) throws XPathException {
  Configuration config = getConfiguration();
  if (function.getNumberOfArguments() == 1) {
    StructuredQName name = function.getFunctionName();
    int fingerprint = config.getNamePool().getFingerprint(name.getNamespaceURI(), name.getLocalName());
    if (fingerprint != -1) {
      SchemaType t = config.getSchemaType(fingerprint);
      if (t != null && t.isAtomicType()) {
        XPathException err = new XPathException("Function name " + function.getDisplayName() +
            " clashes with the name of the constructor function for an atomic type");
        err.setErrorCode("XQST0034");
        err.setIsStaticError(true);
        throw err;
      }
    }
  }
  XQueryFunctionLibrary local = getLocalFunctionLibrary();
  local.declareFunction(function);
  QueryModule main = getTopLevelModule();
  main.globalFunctionLibrary.declareFunction(function);
}

代码示例来源:origin: org.opengis.cite.saxon/saxon9

/**
 * Register a user-defined XQuery function.
 * <p/>
 * This method is intended for internal use only.
 * @param function the function being declared
 */
public void declareFunction(XQueryFunction function) throws XPathException {
  Configuration config = getConfiguration();
  if (function.getNumberOfArguments() == 1) {
    StructuredQName name = function.getFunctionName();
    int fingerprint = config.getNamePool().getFingerprint(name.getNamespaceURI(), name.getLocalName());
    if (fingerprint != -1) {
      SchemaType t = config.getSchemaType(fingerprint);
      if (t != null && t.isAtomicType()) {
        XPathException err = new XPathException("Function name " + function.getDisplayName() +
            " clashes with the name of the constructor function for an atomic type");
        err.setErrorCode("XQST0034");
        err.setIsStaticError(true);
        throw err;
      }
    }
  }
  XQueryFunctionLibrary local = getLocalFunctionLibrary();
  local.declareFunction(function);
  QueryModule main = getTopLevelModule(this);
  main.globalFunctionLibrary.declareFunction(function);
}

代码示例来源:origin: com.helger/ph-schematron

aFunctionResolver.addUniqueFunction (aXQueryFunction.getFunctionName ().getNamespaceBinding ().getURI (),
                   aXQueryFunction.getFunctionName ().getLocalPart (),
                   aXQueryFunction.getNumberOfArguments (),
                   new XPathFunctionFromUserFunction (aConfiguration,
                                    aXQController,

代码示例来源:origin: phax/ph-schematron

aFunctionResolver.addUniqueFunction (aXQueryFunction.getFunctionName ().getNamespaceBinding ().getURI (),
                   aXQueryFunction.getFunctionName ().getLocalPart (),
                   aXQueryFunction.getNumberOfArguments (),
                   new XPathFunctionFromUserFunction (aConfiguration,
                                    aXQController,

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