本文整理匯總了Java中org.jdom.Element.getChildTextTrim方法的典型用法代碼示例。如果您正苦於以下問題:Java Element.getChildTextTrim方法的具體用法?Java Element.getChildTextTrim怎麽用?Java Element.getChildTextTrim使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.jdom.Element
的用法示例。
在下文中一共展示了Element.getChildTextTrim方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: processAnnotationsForResource
import org.jdom.Element; //導入方法依賴的package包/類
/**
* Process the given RESOURCE element, adding extra elements to it based on
* the annotations on the resource class.
*
* @param element
* the RESOURCE element to process.
*/
private void processAnnotationsForResource(Element element)
throws GateException {
String className = element.getChildTextTrim("CLASS");
if(className == null) { throw new GateException(
"\"CLASS\" element not found for resource in " + plugin); }
Class<?> resourceClass = null;
try {
resourceClass = Gate.getClassLoader().loadClass(className);
} catch(ClassNotFoundException e) {
log.debug("Couldn't load class " + className + " for resource in "
+ plugin, e);
throw new GateException("Couldn't load class " + className
+ " for resource in " + plugin);
}
processCreoleResourceAnnotations(element, resourceClass);
}
示例2: getChannelImageUrl
import org.jdom.Element; //導入方法依賴的package包/類
private String getChannelImageUrl(Element channelElement) {
String result = getITunesAttribute(channelElement, "image", "href");
if (result == null) {
Element imageElement = channelElement.getChild("image");
if (imageElement != null) {
result = imageElement.getChildTextTrim("url");
}
}
return result;
}
示例3: getITunesElement
import org.jdom.Element; //導入方法依賴的package包/類
private String getITunesElement(Element element, String childName) {
for (Namespace ns : ITUNES_NAMESPACES) {
String value = element.getChildTextTrim(childName, ns);
if (value != null) {
return value;
}
}
return null;
}
示例4: findResourceElements
import org.jdom.Element; //導入方法依賴的package包/類
@SuppressWarnings("unchecked")
private void findResourceElements(Map<String, Element> map, Element elt) {
if(elt.getName().equals("RESOURCE")) {
String className = elt.getChildTextTrim("CLASS");
if(className != null) {
map.put(className, elt);
}
} else {
for(Element child : (List<Element>)elt.getChildren()) {
findResourceElements(map, child);
}
}
}