gpt4 book ai didi

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

转载 作者:知者 更新时间:2024-03-27 08:45:05 25 4
gpt4 key购买 nike

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

XQueryFunctionLibrary.declareFunction介绍

[英]Register a user-defined XQuery function
[中]注册一个用户定义的XQuery函数

代码示例

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

/**
 * Declare an imported XQuery function
 * @param function the imported function
 */
protected void declareXQueryFunction(XQueryFunction function) throws XPathException {
  queryFunctions.declareFunction(function);
}

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

/**
 * Declare an imported XQuery function
 * @param function the imported function
 */
protected void declareXQueryFunction(XQueryFunction function) throws XPathException {
  queryFunctions.declareFunction(function);
}

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

/**
 * Declare an imported XQuery function
 * @param function the imported function
 */
protected void declareXQueryFunction(XQueryFunction function) throws XPathException {
  queryFunctions.declareFunction(function);
}

代码示例来源: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.sf.saxon/Saxon-HE

/**
 * Declare an imported XQuery function
 *
 * @param function the imported function
 * @throws net.sf.saxon.trans.XPathException if an error occurs
 */
public void declareXQueryFunction(XQueryFunction function) throws XPathException {
  XQueryFunctionLibrary lib = getStylesheetPackage().getXQueryFunctionLibrary();
  if (getStylesheetPackage().getFunction(function.getUserFunction().getSymbolicName()) != null) {
    throw new XPathException("Duplication declaration of " +
                     function.getUserFunction().getSymbolicName(), "XQST0034");
  }
  lib.declareFunction(function);
}

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

/**
 * Declare an imported XQuery function
 *
 * @param function the imported function
 * @throws net.sf.saxon.trans.XPathException if an error occurs
 */
public void declareXQueryFunction(XQueryFunction function) throws XPathException {
  XQueryFunctionLibrary lib = getStylesheetPackage().getXQueryFunctionLibrary();
  if (getStylesheetPackage().getFunction(function.getUserFunction().getSymbolicName()) != null) {
    throw new XPathException("Duplication declaration of " +
                     function.getUserFunction().getSymbolicName(), "XQST0034");
  }
  lib.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);
}

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