本文整理汇总了Java中org.dom4j.tree.DefaultElement.add方法的典型用法代码示例。如果您正苦于以下问题:Java DefaultElement.add方法的具体用法?Java DefaultElement.add怎么用?Java DefaultElement.add使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.dom4j.tree.DefaultElement
的用法示例。
在下文中一共展示了DefaultElement.add方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: buildDocument
import org.dom4j.tree.DefaultElement; //导入方法依赖的package包/类
/**
*/
@Override
public void buildDocument(final DefaultElement parent) {
final DefaultElement orgaElement = new DefaultElement(CPCore.ORGANIZATION);
orgaElement.addAttribute(CPCore.IDENTIFIER, identifier);
orgaElement.addAttribute(CPCore.STRUCTURE, structure);
final DefaultElement titleElement = new DefaultElement(CPCore.TITLE);
titleElement.setText(title);
orgaElement.add(titleElement);
if (metadata != null) {
metadata.buildDocument(orgaElement);
}
for (final Iterator<CPItem> itItem = items.iterator(); itItem.hasNext();) {
final CPItem item = itItem.next();
item.buildDocument(orgaElement);
}
parent.add(orgaElement);
}
示例2: buildDocument
import org.dom4j.tree.DefaultElement; //导入方法依赖的package包/类
/**
* @param doc
*/
public void buildDocument(final DefaultDocument doc) {
// Manifest is the root-node of the document, therefore we need to pass the
// "doc"
final DefaultElement manifestElement = new DefaultElement(CPCore.MANIFEST);
manifestElement.add(new DefaultAttribute(CPCore.IDENTIFIER, this.identifier));
manifestElement.add(new DefaultAttribute(CPCore.SCHEMALOCATION, this.schemaLocation));
// manifestElement.setNamespace(this.getNamespace()); //FIXME: namespace
doc.add(manifestElement);
if (metadata != null) {
metadata.buildDocument(manifestElement);
}
organizations.buildDocument(manifestElement);
resources.buildDocument(manifestElement);
}
示例3: buildDocument
import org.dom4j.tree.DefaultElement; //导入方法依赖的package包/类
/**
*/
@Override
public void buildDocument(final DefaultElement parent) {
// String base = "";
// if(xmlbase != null && !xmlbase.equals("")) base="
// xml:base=\""+xmlbase+"\"";
// TODO: xml base imlement !!!
final DefaultElement resourceElement = new DefaultElement(CPCore.RESOURCE);
resourceElement.addAttribute(CPCore.IDENTIFIER, identifier);
resourceElement.addAttribute(CPCore.TYPE, type);
resourceElement.addAttribute(CPCore.HREF, href);
if (!xmlbase.equals("")) {
resourceElement.addAttribute(CPCore.BASE, xmlbase);
}
if (metadata != null) {
metadata.buildDocument(resourceElement);
}
// build files
for (final Iterator<CPFile> itFiles = files.iterator(); itFiles.hasNext();) {
final CPFile file = itFiles.next();
file.buildDocument(resourceElement);
}
// build dependencies
for (final Iterator<CPDependency> itDep = dependencies.iterator(); itDep.hasNext();) {
final CPDependency dep = itDep.next();
dep.buildDocument(resourceElement);
}
parent.add(resourceElement);
}
示例4: buildDocument
import org.dom4j.tree.DefaultElement; //导入方法依赖的package包/类
/**
*/
@Override
public void buildDocument(final DefaultElement parent) {
final DefaultElement itemElement = new DefaultElement(CPCore.ITEM);
itemElement.addAttribute(CPCore.IDENTIFIER, identifier);
if (!identifierRef.equals("")) {
itemElement.addAttribute(CPCore.IDENTIFIERREF, identifierRef);
}
itemElement.addAttribute(CPCore.ISVISIBLE, isVisibleString());
if (metadata != null) {
metadata.buildDocument(itemElement);
}
final DefaultElement titleElement = new DefaultElement(CPCore.TITLE);
titleElement.setText(title);
itemElement.add(titleElement);
for (final Iterator<CPItem> itItem = items.iterator(); itItem.hasNext();) {
final CPItem item = itItem.next();
item.buildDocument(itemElement);
}
parent.add(itemElement);
}
示例5: buildDocument
import org.dom4j.tree.DefaultElement; //导入方法依赖的package包/类
/**
*/
@Override
public void buildDocument(final DefaultElement parent) {
final DefaultElement fileElement = new DefaultElement(CPCore.FILE);
fileElement.addAttribute(CPCore.HREF, href);
if (metadata != null) {
metadata.buildDocument(fileElement);
}
parent.add(fileElement);
}
示例6: buildDocument
import org.dom4j.tree.DefaultElement; //导入方法依赖的package包/类
@Override
public void buildDocument(final DefaultElement parent) {
final DefaultElement resourceElement = new DefaultElement(CPCore.RESOURCES);
for (final Iterator<CPResource> itResources = resources.iterator(); itResources.hasNext();) {
final CPResource res = itResources.next();
res.buildDocument(resourceElement);
}
parent.add(resourceElement);
}
示例7: buildDocument
import org.dom4j.tree.DefaultElement; //导入方法依赖的package包/类
/**
*/
@Override
public void buildDocument(final DefaultElement parent) {
final DefaultElement orgaElement = new DefaultElement(CPCore.ORGANIZATIONS);
for (final Iterator<CPOrganization> itOrgas = orgas.iterator(); itOrgas.hasNext();) {
final CPOrganization org = itOrgas.next();
org.buildDocument(orgaElement);
}
parent.add(orgaElement);
}
示例8: buildDocument
import org.dom4j.tree.DefaultElement; //导入方法依赖的package包/类
/**
*/
@Override
public void buildDocument(final DefaultElement parent) {
final DefaultElement depElement = new DefaultElement(CPCore.DEPENDENCY);
depElement.addAttribute(CPCore.IDENTIFIERREF, identifierRef);
parent.add(depElement);
}
示例9: buildDocument
import org.dom4j.tree.DefaultElement; //导入方法依赖的package包/类
/**
*/
@Override
public void buildDocument(final DefaultElement parent) {
final DefaultElement metaElement = new DefaultElement(CPCore.METADATA);
metaElement.setContent(this.content());
parent.add(metaElement);
}
示例10: addIgnoreExchangeEventProperty
import org.dom4j.tree.DefaultElement; //导入方法依赖的package包/类
private void addIgnoreExchangeEventProperty(CamelProcessItem item) throws PersistenceException, DocumentException {
String springContent = item.getSpringContent();
if (null != springContent && !springContent.isEmpty()) {
Document document = DocumentHelper.parseText(springContent);
QName qname = QName.get("bean", SPRING_BEANS_NAMESPACE);
List<Element> beans = document.getRootElement().elements(qname);
for (Element bean : beans) {
if ("jmxEventNotifier".equals(bean.attributeValue("id")) &&
"org.apache.camel.management.JmxNotificationEventNotifier".equals(bean.attributeValue("class")))
{
List<Element> properties = bean.elements(QName.get("property", SPRING_BEANS_NAMESPACE));
boolean hasIgnore = false;
for (Element property : properties) {
List<Attribute> propertyAttributes = property.attributes();
for (Attribute propertyAttribute : propertyAttributes) {
if (propertyAttribute.getValue().equals(IGNORE_EXCHANGE_EVENTS)) {
hasIgnore = true;
break;
}
}
}
if (!hasIgnore)
{
DefaultElement ignoreExchangeElement = new DefaultElement("property", bean.getNamespace());
ignoreExchangeElement.add(DocumentHelper.createAttribute(ignoreExchangeElement, "name", IGNORE_EXCHANGE_EVENTS));
ignoreExchangeElement.add(DocumentHelper.createAttribute(ignoreExchangeElement, "value", "true"));
bean.add(ignoreExchangeElement);
item.setSpringContent(document.asXML());
saveItem(item);
}
break;
}
}
}
}