本文整理了Java中org.jdom2.Element.removeChildren()
方法的一些代码示例,展示了Element.removeChildren()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Element.removeChildren()
方法的具体详情如下:
包路径:org.jdom2.Element
类名称:Element
方法名:removeChildren
[英]This removes all child elements (one level deep) with the given local name and belonging to no namespace. Returns true if any were removed.
[中]这将删除具有给定本地名称且不属于任何命名空间的所有子元素(一级深度)。如果删除了任何内容,则返回true。
代码示例来源:origin: org.jdom/jdom
/**
* <p>
* This removes all child elements (one level deep) with the
* given local name and belonging to no namespace.
* Returns true if any were removed.
* </p>
*
* @param cname the name of child elements to remove
* @return whether deletion occurred
*/
public boolean removeChildren(final String cname) {
return removeChildren(cname, Namespace.NO_NAMESPACE);
}
代码示例来源:origin: org.codehaus.plexus/plexus-component-metadata
/**
* @see org.jdom2.Element#removeChildren(java.lang.String)
* @param name name of the child.
* @return true/false.
*/
public boolean removeChildren( String name )
{
return element.removeChildren( name );
}
代码示例来源:origin: org.codehaus.plexus/plexus-component-metadata
/**
* @see org.jdom2.Element#removeChildren(java.lang.String,org.jdom2.Namespace)
* @param name The name of the child.
* @param ns {@link Namespace}
* @return true/false.
*/
public boolean removeChildren( String name, Namespace ns )
{
return element.removeChildren( name, ns );
}
代码示例来源:origin: apache/ctakes
private static Element removeSingleChild(Element elem, String elemName, String causeID) {
Element child = getSingleChild(elem, elemName, causeID);
elem.removeChildren(elemName);
return child;
}
代码示例来源:origin: apache/ctakes
private static Element removeSingleChild(Element elem, String elemName, String causeID) {
Element child = getSingleChild(elem, elemName, causeID);
elem.removeChildren(elemName);
return child;
}
代码示例来源:origin: org.apache.ctakes/ctakes-relation-extractor
private static Element removeSingleChild(Element elem, String elemName, String causeID) {
Element child = getSingleChild(elem, elemName, causeID);
elem.removeChildren(elemName);
return child;
}
代码示例来源:origin: apache/ctakes
private static String removeSingleChildText(Element elem, String elemName, String causeID) {
Element child = getSingleChild(elem, elemName, causeID);
String text = child.getText();
if (text.isEmpty()) {
error(String.format("an empty '%s' child", elemName), causeID);
text = null;
}
elem.removeChildren(elemName);
return text;
}
代码示例来源:origin: apache/ctakes
private static String removeSingleChildText(Element elem, String elemName, String causeID) {
Element child = getSingleChild(elem, elemName, causeID);
String text = child.getText();
if (text.isEmpty()) {
error(String.format("an empty '%s' child", elemName), causeID);
text = null;
}
elem.removeChildren(elemName);
return text;
}
代码示例来源:origin: org.apache.ctakes/ctakes-relation-extractor
private static String removeSingleChildText(Element elem, String elemName, String causeID) {
Element child = getSingleChild(elem, elemName, causeID);
String text = child.getText();
if (text.isEmpty()) {
error(String.format("an empty '%s' child", elemName), causeID);
text = null;
}
elem.removeChildren(elemName);
return text;
}
代码示例来源:origin: org.mycore/mycore-orcid
/**
* Parses the bibTeX code that may be included in the work entry
* and returns its transformation to MODS
*/
private Optional<Element> bibTeX2MODS(String bibTeX) {
if ((bibTeX != null) && !bibTeX.isEmpty()) {
try {
MCRContent result = T_BIBTEX2MODS.transform(new MCRStringContent(bibTeX));
Element modsCollection = result.asXML().getRootElement();
Element modsFromBibTeX = modsCollection.getChild("mods", MCRConstants.MODS_NAMESPACE);
// Remove mods:extension containing the original BibTeX:
modsFromBibTeX.removeChildren("extension", MCRConstants.MODS_NAMESPACE);
return Optional.of(modsFromBibTeX);
} catch (Exception ex) {
String msg = "Exception parsing BibTeX: " + bibTeX;
LOGGER.warn("{} {}", msg, ex.getMessage());
}
}
return Optional.empty();
}
}
代码示例来源:origin: org.mycore/mycore-mods
private Element cloneRelatedItem(Element relatedItem) {
Element mods = relatedItem.clone();
mods.setName("mods");
mods.removeAttribute("type");
mods.removeAttribute("href", MCRConstants.XLINK_NAMESPACE);
mods.removeAttribute("type", MCRConstants.XLINK_NAMESPACE);
mods.removeChildren("part", MCRConstants.MODS_NAMESPACE);
return mods;
}
代码示例来源:origin: org.mycore/mycore-restapi
eRoot.removeChildren("category");
代码示例来源:origin: apache/ctakes
propertiesElem.removeChildren("Coreferring_String");
}else{
LOGGER.warn(String.format("This script cannot process relations of type %s yet.", type));
内容来源于网络,如有侵权,请联系作者删除!