本文整理匯總了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);
}
示例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");
}
}
}
示例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;
}