本文整理了Java中org.jdom.Element.removeChildren()
方法的一些代码示例,展示了Element.removeChildren()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Element.removeChildren()
方法的具体详情如下:
包路径:org.jdom.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-legacy
/**
* <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 name the name of child elements to remove
* @return whether deletion occurred
*/
public boolean removeChildren(final String name) {
return removeChildren(name, Namespace.NO_NAMESPACE);
}
代码示例来源:origin: org.codehaus.xfire/xfire-core
public boolean removeChildren(String name, Namespace ns)
{
return element.removeChildren(name, ns);
}
代码示例来源:origin: org.codehaus.xfire/xfire-core
public boolean removeChildren(String name)
{
return element.removeChildren(name);
}
代码示例来源:origin: edu.washington.cs.knowitall/nlp
public Element toXmlElement() {
Element e = super.toXmlElement();
e.removeChildren("pattern");
for (TermConstraint constraint : this.constraints) {
e.addContent(constraint.toSubsequenceXmlElement());
}
return e;
}
}
代码示例来源:origin: apache/oozie
private void removeSlaElements(Element eWfJob) {
Element sla = XmlUtils.getSLAElement(eWfJob);
if (sla != null) {
eWfJob.removeChildren(sla.getName(), sla.getNamespace());
}
for (Element action : (List<Element>) eWfJob.getChildren("action", eWfJob.getNamespace())) {
sla = XmlUtils.getSLAElement(action);
if (sla != null) {
action.removeChildren(sla.getName(), sla.getNamespace());
}
}
}
private String verifySlaElements(Element eWfJob, ELEvaluator evalSla) throws CommandException {
代码示例来源:origin: org.apache.oozie/oozie-core
private void removeSlaElements(Element eWfJob) {
Element sla = XmlUtils.getSLAElement(eWfJob);
if (sla != null) {
eWfJob.removeChildren(sla.getName(), sla.getNamespace());
}
for (Element action : (List<Element>) eWfJob.getChildren("action", eWfJob.getNamespace())) {
sla = XmlUtils.getSLAElement(action);
if (sla != null) {
action.removeChildren(sla.getName(), sla.getNamespace());
}
}
}
private String verifySlaElements(Element eWfJob, ELEvaluator evalSla) throws CommandException {
代码示例来源:origin: org.sakaiproject.metaobj/sakai-metaobj-impl
protected Content i18nFilterAnnotations(Element content) throws JDOMException {
Locale locale = rl.getLocale();
Map<String, Element> documentElements = new Hashtable<String, Element>();
filterElements(documentElements, content, null);
filterElements(documentElements, content, locale.getLanguage());
filterElements(documentElements, content, locale.getLanguage()
+ "_" + locale.getCountry());
filterElements(documentElements, content, locale.getLanguage()
+ "_" + locale.getCountry() + "_" + locale.getVariant());
Element returned = (Element) content.clone();
returned.removeChildren("documentation", content.getNamespace());
for (Iterator<Element> i=documentElements.values().iterator();i.hasNext();) {
returned.addContent((Content) i.next().clone());
}
return returned;
}
代码示例来源:origin: apache/oozie
/**
* Resolve list of <instance> </instance> tags.
*
* @param event
* @param instances
* @param actionInst
* @param conf
* @param eval ELEvalautor
* @throws Exception
*/
public static void resolveInstances(Element event, StringBuilder instances, SyncCoordAction actionInst,
Configuration conf, ELEvaluator eval) throws Exception {
for (Element eInstance : (List<Element>) event.getChildren("instance", event.getNamespace())) {
if (instances.length() > 0) {
instances.append(CoordELFunctions.INSTANCE_SEPARATOR);
}
instances.append(materializeInstance(event, eInstance.getTextTrim(), actionInst, conf, eval));
}
event.removeChildren("instance", event.getNamespace());
}
代码示例来源:origin: org.apache.oozie/oozie-core
/**
* Resolve list of <instance> </instance> tags.
*
* @param event
* @param instances
* @param actionInst
* @param conf
* @param eval ELEvalautor
* @throws Exception
*/
public static void resolveInstances(Element event, StringBuilder instances, SyncCoordAction actionInst,
Configuration conf, ELEvaluator eval) throws Exception {
for (Element eInstance : (List<Element>) event.getChildren("instance", event.getNamespace())) {
if (instances.length() > 0) {
instances.append(CoordELFunctions.INSTANCE_SEPARATOR);
}
instances.append(materializeInstance(event, eInstance.getTextTrim(), actionInst, conf, eval));
}
event.removeChildren("instance", event.getNamespace());
}
代码示例来源:origin: org.n52.wps/52n-wps-configuration-api
setElement(consoleAppenderEncoderPatternElement, logConfigurations.getWpsconsoleEncoderPattern());
root.removeChildren("logger");
SortedMap<String, String> loggersMap = logConfigurations.getLoggers();
rootLevelElement.setAttribute("level", logConfigurations.getRootLevel());
rootLevelElement.removeChildren("appender-ref");
if (logConfigurations.isFileAppenderEnabled()) {
setAppender(rootLevelElement, "wpsfile");
代码示例来源:origin: org.cytoscape/plugin-impl
/**
* Adds the given ThemeInof object to the list of themes sharing the given
* status.
*
* @param obj
* @param Status
*/
private void addTheme(ThemeInfo obj, PluginStatus Status) {
Element ThemeParent = trackerDoc.getRootElement().getChild(Status.getTagName());
Element Theme = getMatchingInfoObj(obj, Status);
if (Theme != null) {
Theme = updateBasicElement(obj, Theme);
Theme.getChild(PluginXml.PLUGIN_LIST.getTag()).removeChildren(PluginXml.PLUGIN.getTag());
for (PluginInfo plugin: obj.getPlugins()) {
Element ThemePlugin = getMatchingInfoObj(plugin, Status); // XXX not sure this will get the right element
ThemePlugin = updatePluginElement(plugin, ThemePlugin);
Theme.getChild(PluginXml.PLUGIN_LIST.getTag()).addContent(ThemePlugin);
}
} else {
Theme = createThemeContent(obj);
ThemeParent.addContent(Theme);
this.infoObjMap.put(infoMapKey(obj, Status), Theme);
logger.info("Adding theme " + obj.getName() + " status " + Status.name());
}
write();
}
代码示例来源:origin: cytoscape/application
/**
* Adds the given ThemeInof object to the list of themes sharing the given
* status.
*
* @param obj
* @param Status
*/
private void addTheme(ThemeInfo obj, PluginStatus Status) {
Element ThemeParent = trackerDoc.getRootElement().getChild(Status.getTagName());
Element Theme = getMatchingInfoObj(obj, Status);
if (Theme != null) {
Theme = updateBasicElement(obj, Theme);
Theme.getChild(PluginXml.PLUGIN_LIST.getTag()).removeChildren(PluginXml.PLUGIN.getTag());
for (PluginInfo plugin: obj.getPlugins()) {
Element ThemePlugin = getMatchingInfoObj(plugin, Status); // XXX not sure this will get the right element
ThemePlugin = updatePluginElement(plugin, ThemePlugin);
Theme.getChild(PluginXml.PLUGIN_LIST.getTag()).addContent(ThemePlugin);
}
} else {
Theme = createThemeContent(obj);
ThemeParent.addContent(Theme);
this.infoObjMap.put(infoMapKey(obj, Status), Theme);
logger.info("Adding theme " + obj.getName() + " status " + Status.name());
}
write();
}
代码示例来源:origin: org.n52.wps/52n-wps-configuration-api
setElement(getElement(serviceIdentificationElement, "ServiceType"), serviceIdentification.getServiceType());
serviceIdentificationElement.removeChildren("ServiceTypeVersion", Namespace.getNamespace(NAMESPACE));
keywords.removeChildren("Keyword", Namespace.getNamespace(NAMESPACE));
内容来源于网络,如有侵权,请联系作者删除!