org.dom4j.Element.addComment()方法的使用及代码示例

x33g5p2x  于2022-01-18 转载在 其他  
字(5.5k)|赞(0)|评价(0)|浏览(355)

本文整理了Java中org.dom4j.Element.addComment()方法的一些代码示例,展示了Element.addComment()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Element.addComment()方法的具体详情如下:
包路径:org.dom4j.Element
类名称:Element
方法名:addComment

Element.addComment介绍

[英]Adds a new Comment node with the given text to this element.
[中]将具有给定文本的新Comment节点添加到此元素。

代码示例

代码示例来源:origin: igniterealtime/Openfire

parent.addComment(pp.getText());

代码示例来源:origin: org.dom4j/dom4j

public void comment(char[] ch, int start, int end) throws SAXException {
  if (!ignoreComments) {
    if (mergeAdjacentText && textInTextBuffer) {
      completeCurrentTextNode();
    }
    String text = new String(ch, start, end);
    if (!insideDTDSection && (text.length() > 0)) {
      if (currentElement != null) {
        currentElement.addComment(text);
      } else {
        getDocument().addComment(text);
      }
    }
  }
}

代码示例来源:origin: org.dom4j/dom4j

((Element) current).addComment(node.getNodeValue());
} else {
  ((Document) current).addComment(node.getNodeValue());

代码示例来源:origin: org.hibernate/com.springsource.org.hibernate.core

public Element addComment(String text) {
  return element.addComment( text );
}

代码示例来源:origin: org.hibernate/com.springsource.org.hibernate

public Element addComment(String text) {
  return element.addComment( text );
}

代码示例来源:origin: hibernate/hibernate

public Element addComment(String text) {
  return element.addComment( text );
}

代码示例来源:origin: jboss.jboss-embeddable-ejb3/hibernate-all

public Element addComment(String text) {
  return element.addComment( text );
}

代码示例来源:origin: hibernate/hibernate

public Element addComment(String text) {
  return target().addComment( text );
}

代码示例来源:origin: jboss.jboss-embeddable-ejb3/hibernate-all

public Element addComment(String text) {
  return target().addComment( text );
}

代码示例来源:origin: org.hibernate/com.springsource.org.hibernate

public Element addComment(String text) {
  return target().addComment( text );
}

代码示例来源:origin: org.hibernate/com.springsource.org.hibernate.core

public Element addComment(String text) {
  return target().addComment( text );
}

代码示例来源:origin: org.dom4j/dom4j

parent.addComment(pp.getText());
} else {
  document.addComment(pp.getText());

代码示例来源:origin: org.opencms/opencms-core

/**
 * @see org.opencms.xml.types.I_CmsXmlSchemaType#generateXml(org.opencms.file.CmsObject, org.opencms.xml.I_CmsXmlDocument, org.dom4j.Element, java.util.Locale)
 */
@Override
public Element generateXml(CmsObject cms, I_CmsXmlDocument document, Element root, Locale locale) {
  Element element = root.addElement(getName());
  element.addComment("Categories are read dynamically");
  return element;
}

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.dom4j

public void comment(char[] ch, int start, int end) throws SAXException {
  if (!ignoreComments) {
    if (mergeAdjacentText && textInTextBuffer) {
      completeCurrentTextNode();
    }
    String text = new String(ch, start, end);
    if (!insideDTDSection && (text.length() > 0)) {
      if (currentElement != null) {
        currentElement.addComment(text);
      } else {
        getDocument().addComment(text);
      }
    }
  }
}

代码示例来源:origin: dom4j/dom4j

public void comment(char[] ch, int start, int end) throws SAXException {
  if (!ignoreComments) {
    if (mergeAdjacentText && textInTextBuffer) {
      completeCurrentTextNode();
    }
    String text = new String(ch, start, end);
    if (!insideDTDSection && (text.length() > 0)) {
      if (currentElement != null) {
        currentElement.addComment(text);
      } else {
        getDocument().addComment(text);
      }
    }
  }
}

代码示例来源:origin: maven/dom4j

public void comment(char[] ch, int start, int end) throws SAXException {
  if (!ignoreComments) {
    if (mergeAdjacentText && textInTextBuffer) {
      completeCurrentTextNode();
    }
    String text = new String(ch, start, end);
    if (!insideDTDSection && (text.length() > 0)) {
      if (currentElement != null) {
        currentElement.addComment(text);
      } else {
        getDocument().addComment(text);
      }
    }
  }
}

代码示例来源:origin: org.dom4j/com.springsource.org.dom4j

public void comment(char[] ch, int start, int end) throws SAXException {
  if (!ignoreComments) {
    if (mergeAdjacentText && textInTextBuffer) {
      completeCurrentTextNode();
    }
    String text = new String(ch, start, end);
    if (!insideDTDSection && (text.length() > 0)) {
      if (currentElement != null) {
        currentElement.addComment(text);
      } else {
        getDocument().addComment(text);
      }
    }
  }
}

代码示例来源:origin: org.dom4j/org.motechproject.org.dom4j

public void comment(char[] ch, int start, int end) throws SAXException {
  if (!ignoreComments) {
    if (mergeAdjacentText && textInTextBuffer) {
      completeCurrentTextNode();
    }
    String text = new String(ch, start, end);
    if (!insideDTDSection && (text.length() > 0)) {
      if (currentElement != null) {
        currentElement.addComment(text);
      } else {
        getDocument().addComment(text);
      }
    }
  }
}

代码示例来源:origin: apache/servicemix-bundles

public void comment(char[] ch, int start, int end) throws SAXException {
  if (!ignoreComments) {
    if (mergeAdjacentText && textInTextBuffer) {
      completeCurrentTextNode();
    }
    String text = new String(ch, start, end);
    if (!insideDTDSection && (text.length() > 0)) {
      if (currentElement != null) {
        currentElement.addComment(text);
      } else {
        getDocument().addComment(text);
      }
    }
  }
}

代码示例来源:origin: dom4j/dom4j

public void testPrettyPrinting() throws Exception {
  Document doc = DocumentFactory.getInstance().createDocument();
  doc.addElement("summary").addAttribute("date", "6/7/8").addElement(
      "orderline").addText("puffins").addElement("ranjit")
      .addComment("Ranjit is a happy Puffin");
  XMLWriter writer = new XMLWriter(System.out, OutputFormat
      .createPrettyPrint());
  writer.write(doc);
  doc = DocumentFactory.getInstance().createDocument();
  doc.addElement("summary").addAttribute("date", "6/7/8").addElement(
      "orderline").addText("puffins").addElement("ranjit")
      .addComment("Ranjit is a happy Puffin").addComment(
          "another comment").addElement("anotherElement");
  writer.write(doc);
}

相关文章

Element类方法