The Comment Class

The org.jdom.Comment class represents an XML comment such as <-- Remember to verify this -->. As you can see from Example 15.15, Comment is a very simple class that contains some string data, the usual getParent() and getDocument() methods, and the customary Java utility methods such as equals() and toString().

Example 15.15. The JDOM Comment Class
 package org.jdom; public class Comment implements Serializable, Cloneable { protected String text; protected Object parent; protected Comment(); public Comment(String text); public Element getParent(); protected Comment setParent(Element parent); public Comment detach(); public Document getDocument(); protected Comment setDocument(Document document); public String getText(); public ...

Get Processing XML with Java™: A Guide to SAX, DOM, JDOM, JAXP, and TrAX now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.