gpt4 book ai didi

org.apache.commons.configuration.tree.xpath.XPathExpressionEngine.query()方法的使用及代码示例

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

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

XPathExpressionEngine.query介绍

[英]Executes a query. The passed in property key is directly passed to a JXPath context.
[中]执行查询。传入的属性键直接传递给JXPath上下文。

代码示例

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.commons-configuration

/**
 * Tries to generate a key for adding a property. This method is called if a
 * key was used for adding properties which does not contain a space
 * character. It splits the key at its single components and searches for
 * the last existing component. Then a key compatible for adding properties
 * is generated.
 *
 * @param root the root node of the configuration
 * @param key the key in question
 * @return the key to be used for adding the property
 */
private String generateKeyForAdd(ConfigurationNode root, String key)
{
  int pos = key.lastIndexOf(PATH_DELIMITER, key.length());
  while (pos >= 0)
  {
    String keyExisting = key.substring(0, pos);
    if (!query(root, keyExisting).isEmpty())
    {
      StringBuilder buf = new StringBuilder(key.length() + 1);
      buf.append(keyExisting).append(SPACE);
      buf.append(key.substring(pos + 1));
      return buf.toString();
    }
    pos = key.lastIndexOf(PATH_DELIMITER, pos - 1);
  }
  return SPACE + key;
}

代码示例来源:origin: org.apache.commons/org.motechproject.org.apache.commons.configuration

/**
 * Tries to generate a key for adding a property. This method is called if a
 * key was used for adding properties which does not contain a space
 * character. It splits the key at its single components and searches for
 * the last existing component. Then a key compatible for adding properties
 * is generated.
 *
 * @param root the root node of the configuration
 * @param key the key in question
 * @return the key to be used for adding the property
 */
private String generateKeyForAdd(ConfigurationNode root, String key)
{
  int pos = key.lastIndexOf(PATH_DELIMITER, key.length());
  while (pos >= 0)
  {
    String keyExisting = key.substring(0, pos);
    if (!query(root, keyExisting).isEmpty())
    {
      StringBuilder buf = new StringBuilder(key.length() + 1);
      buf.append(keyExisting).append(SPACE);
      buf.append(key.substring(pos + 1));
      return buf.toString();
    }
    pos = key.lastIndexOf(PATH_DELIMITER, pos - 1);
  }
  return SPACE + key;
}

代码示例来源:origin: org.apache.commons/org.motechproject.org.apache.commons.configuration

List<ConfigurationNode> nodes = query(root, addKey.substring(0, index).trim());
if (nodes.size() != 1)

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.commons-configuration

List<ConfigurationNode> nodes = query(root, addKey.substring(0, index).trim());
if (nodes.size() != 1)

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