本文整理汇总了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;
}