当前位置: 首页>>代码示例>>Java>>正文


Java Element.getName方法代码示例

本文整理汇总了Java中org.jdom.Element.getName方法的典型用法代码示例。如果您正苦于以下问题:Java Element.getName方法的具体用法?Java Element.getName怎么用?Java Element.getName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.jdom.Element的用法示例。


在下文中一共展示了Element.getName方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: checkNotNullAndLength

import org.jdom.Element; //导入方法依赖的package包/类
protected void checkNotNullAndLength(Element parent, String childName, int minLen, int maxLen) throws FeedException {
    Element  child = parent.getChild(childName,getFeedNamespace());
    if (child == null) {
        throw new FeedException("Invalid "+getType()+" feed, missing "+parent.getName()+" "+childName);
    }
    checkLength(parent,childName,minLen,maxLen);
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:8,代码来源:RSS090Generator.java

示例2: checkLength

import org.jdom.Element; //导入方法依赖的package包/类
protected void checkLength(Element parent, String childName, int minLen, int maxLen) throws FeedException {
    Element  child = parent.getChild(childName,getFeedNamespace());
    if (child != null) {
        if (minLen>0 && child.getText().length()<minLen) {
            throw new FeedException("Invalid "+getType()+" feed, "+parent.getName()+" "+childName + "short of "+minLen+" length");
        }
        if (maxLen>-1 && child.getText().length()>maxLen) {
            throw new FeedException("Invalid "+getType()+" feed, "+parent.getName()+" "+childName + "exceeds "+maxLen+" length");
        }
    }
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:12,代码来源:RSS090Generator.java

示例3: suggest

import org.jdom.Element; //导入方法依赖的package包/类
@SuppressWarnings("unchecked")
public static List<UpgradePath> suggest(Document doc)
    throws IOException, JDOMException {

  List<UpgradePath> upgrades = new ArrayList<UpgradePath>();

  Element root = doc.getRootElement();

  Element pluginList = root.getChild("urlList").getChild("localList");

  List<Element> plugins = pluginList.getChildren();

  Iterator<Element> it = plugins.iterator();
  while(it.hasNext()) {
    Element plugin = it.next();
    switch(plugin.getName()){
      case "gate.util.persistence.PersistenceManager-URLHolder":
        String urlString = plugin.getChild("urlString").getValue();
        String[] parts = urlString.split("/");

        String oldName = parts[parts.length - 1];
        String newName = oldName.toLowerCase().replaceAll("[\\s_]+", "-");

        VersionRangeResult versions =
            getPluginVersions("uk.ac.gate.plugins", newName);

        if(versions != null) {

          upgrades
              .add(new UpgradePath(plugin, urlString, "uk.ac.gate.plugins",
                  newName, versions, versions.getHighestVersion()));

          break;
        }
      case "gate.creole.Plugin-Maven":
        // TODO check to see if there is a newer version of the plugin to use
        break;
      default:
        // some unknown plugin type
        break;
    }
  }

  return upgrades;
}
 
开发者ID:GateNLP,项目名称:gate-core,代码行数:46,代码来源:UpgradeXGAPP.java


注:本文中的org.jdom.Element.getName方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。