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


Java DefaultElement.addAttribute方法代码示例

本文整理汇总了Java中org.dom4j.tree.DefaultElement.addAttribute方法的典型用法代码示例。如果您正苦于以下问题:Java DefaultElement.addAttribute方法的具体用法?Java DefaultElement.addAttribute怎么用?Java DefaultElement.addAttribute使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.dom4j.tree.DefaultElement的用法示例。


在下文中一共展示了DefaultElement.addAttribute方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: endNode

import org.dom4j.tree.DefaultElement; //导入方法依赖的package包/类
public void endNode()
{
  try
  {
    if (!this.children)
    {
      DefaultElement localDefaultElement = new DefaultElement((String)this.elementStack.pop());
      for (int i = 0; i < this.attributes.getLength(); i++)
        localDefaultElement.addAttribute(this.attributes.getQName(i), this.attributes.getValue(i));
      this.writer.write(localDefaultElement);
      this.attributes.clear();
      this.children = true;
      this.started = true;
      return;
    }
    startElement();
    this.writer.endElement("", "", (String)this.elementStack.pop());
    return;
  }
  catch (SAXException localSAXException)
  {
    throw new StreamException(localSAXException);
  }
  catch (IOException localIOException)
  {
    throw new StreamException(localIOException);
  }
}
 
开发者ID:mmmsplay10,项目名称:QuizUpWinner,代码行数:29,代码来源:Dom4JXmlWriter.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 depElement = new DefaultElement(CPCore.DEPENDENCY);
      depElement.addAttribute(CPCore.IDENTIFIERREF, identifierRef);
      parent.add(depElement);
  }
 
开发者ID:huihoo,项目名称:olat,代码行数:9,代码来源:CPDependency.java

示例7: createAuthEl

import org.dom4j.tree.DefaultElement; //导入方法依赖的package包/类
private static Element createAuthEl(String name, String authenticationText) {
    if (name == null) {
        throw new NullPointerException(
                "SASL mechanism name shouldn't be null.");
    }
    DefaultElement authEl = new DefaultElement("auth",
            Namespace.get("urn:ietf:params:xml:ns:xmpp-sasl"));
    authEl.addAttribute("mechanism", name);
    if (authenticationText != null) {
        authEl.setText(authenticationText);
    }
    return authEl;
}
 
开发者ID:abmargb,项目名称:jamppa,代码行数:14,代码来源:SASLMechanism.java


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