當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。