gpt4 book ai didi

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

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

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

XQueryFunction.getDisplayName介绍

[英]Get the name of the function for display in error messages
[中]获取要在错误消息中显示的函数的名称

代码示例

代码示例来源:origin: dsukhoroslov/bagri

private <R> List<R> lookupFunctions(FunctionLibraryList fll, FunctionExtractor<R> ext) {
  List<R> fl = new ArrayList<>();
  for (FunctionLibrary lib: fll.getLibraryList()) {
    logger.trace("lookupFunctions; function library: {}; class: {}", lib.toString(), lib.getClass().getName());
    if (lib instanceof FunctionLibraryList) {
      fl.addAll(lookupFunctions((FunctionLibraryList) lib, ext));
    //} else if (lib instanceof ExecutableFunctionLibrary) {
    //	ExecutableFunctionLibrary efl = (ExecutableFunctionLibrary) lib;
    //	Iterator<UserFunction> itr = efl.iterateFunctions();
    //	while (itr.hasNext()) {
    //		fl.add(getFunctionDeclaration(itr.next()));
    //	}
    } else if (lib instanceof XQueryFunctionLibrary) {
      XQueryFunctionLibrary xqfl = (XQueryFunctionLibrary) lib;
      Iterator<XQueryFunction> itr = xqfl.getFunctionDefinitions();
      while (itr.hasNext()) {
        XQueryFunction fn = itr.next();
        logger.trace("lookupFunctions; fn: {}", fn.getDisplayName());
        R result = ext.extractFunction(fn.getUserFunction());
        if (result != null) {
          fl.add(result);
        }
      }
    }
  }
  return fl;
}

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

/**
 * Register a user-defined XQuery function
 * @param function the function to be registered
 * @throws XPathException if there is an existing function with the same name and arity
 */
public void declareFunction(XQueryFunction function) throws XPathException {
  String keyObj = function.getIdentificationKey();
  XQueryFunction existing = (XQueryFunction)functions.get(keyObj);
  if (existing != null) {
    XPathException err = new XPathException("Duplicate definition of function " +
        function.getDisplayName() +
        " (see line " + existing.getLineNumber() + " in " + existing.getSystemId() + ')');
    err.setErrorCode("XQST0034");
    err.setIsStaticError(true);
    err.setLocator(function);
    throw err;
  }
  functions.put(keyObj, function);
}

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

/**
 * Register a user-defined XQuery function
 * @param function the function to be registered
 * @throws XPathException if there is an existing function with the same name and arity
 */
public void declareFunction(XQueryFunction function) throws XPathException {
  String keyObj = function.getIdentificationKey();
  XQueryFunction existing = (XQueryFunction)functions.get(keyObj);
  if (existing != null) {
    XPathException err = new XPathException("Duplicate definition of function " +
        function.getDisplayName() +
        " (see line " + existing.getLineNumber() + " in " + existing.getSystemId() + ')');
    err.setErrorCode("XQST0034");
    err.setIsStaticError(true);
    err.setLocator(function);
    throw err;
  }
  functions.put(keyObj, function);
}

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

/**
 * Register a user-defined XQuery function
 *
 * @param function the function to be registered
 * @throws XPathException if there is an existing function with the same name and arity
 */
public void declareFunction(/*@NotNull*/ XQueryFunction function) throws XPathException {
  SymbolicName keyObj = function.getIdentificationKey();
  XQueryFunction existing = functions.get(keyObj);
  if (existing == function) {
    return;
  }
  if (existing != null) {
    XPathException err = new XPathException("Duplicate definition of function " +
        function.getDisplayName() +
        " (see line " + existing.getLineNumber() + " in " + existing.getSystemId() + ')');
    err.setErrorCode("XQST0034");
    err.setIsStaticError(true);
    err.setLocator(function);
    throw err;
  }
  functions.put(keyObj, function);
}

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

/**
 * Register a user-defined XQuery function
 *
 * @param function the function to be registered
 * @throws XPathException if there is an existing function with the same name and arity
 */
public void declareFunction(/*@NotNull*/ XQueryFunction function) throws XPathException {
  SymbolicName keyObj = function.getIdentificationKey();
  XQueryFunction existing = functions.get(keyObj);
  if (existing == function) {
    return;
  }
  if (existing != null) {
    XPathException err = new XPathException("Duplicate definition of function " +
        function.getDisplayName() +
        " (see line " + existing.getLineNumber() + " in " + existing.getSystemId() + ')');
    err.setErrorCode("XQST0034");
    err.setIsStaticError(true);
    err.setLocator(function);
    throw err;
  }
  functions.put(keyObj, function);
}

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

} else {
  msg += "signature of imported function " +
      ((XQueryFunction)declaration).getDisplayName();

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

} else {
  msg += "signature of imported function " +
      ((XQueryFunction)declaration).getDisplayName();

代码示例来源: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

/**
 * 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: net.sf.saxon/Saxon-HE

body = opt.makeByteCodeCandidate(compiledFunction, body, getDisplayName(),
                 Expression.PROCESS_METHOD | Expression.ITERATE_METHOD);

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

body = opt.makeByteCodeCandidate(compiledFunction, body, getDisplayName(),
                 Expression.PROCESS_METHOD | Expression.ITERATE_METHOD);

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