当前位置: 首页>>代码示例>>Java>>正文


Java DefaultElement.add方法代码示例

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

  }
 
开发者ID:huihoo,项目名称:olat,代码行数:25,代码来源:CPOrganization.java

示例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);

}
 
开发者ID:huihoo,项目名称:olat,代码行数:22,代码来源:CPManifest.java

示例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);
  }
 
开发者ID:huihoo,项目名称:olat,代码行数:38,代码来源:CPResource.java

示例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);

  }
 
开发者ID:huihoo,项目名称:olat,代码行数:29,代码来源:CPItem.java

示例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);
  }
 
开发者ID:huihoo,项目名称:olat,代码行数:12,代码来源:CPFile.java

示例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);
}
 
开发者ID:huihoo,项目名称:olat,代码行数:11,代码来源:CPResources.java

示例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);
  }
 
开发者ID:huihoo,项目名称:olat,代码行数:13,代码来源:CPOrganizations.java

示例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);
  }
 
开发者ID:huihoo,项目名称:olat,代码行数:9,代码来源:CPDependency.java

示例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);
  }
 
开发者ID:huihoo,项目名称:olat,代码行数:9,代码来源:CPMetadata.java

示例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;
			}
		}
	}
}
 
开发者ID:Talend,项目名称:tesb-studio-se,代码行数:36,代码来源:AddSpringConfigurationPropertyMigrationTask.java


注:本文中的org.dom4j.tree.DefaultElement.add方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。