[jdom-commits] CVS Update: jdom
nobody at chimbo.servlets.com
Tue May 20 14:53:59 PDT 2003
Date: Tue May 20, 2003 @15:53:59 MDT
Update of /home/cvs/jdom
In directory chimbo:/tmp/cvs-serv4155
BIG CHANGE. Comments welcome!
Added two new interfaces, Parent and Child.
Parent has methods (* means new):
CVS TODO.txt package src int getChildCount();
Parent addContent(Child child);
CVS TODO.txt package src Parent addContent(Collection collection);
CVS TODO.txt package src Parent addContent(int index, Child child);
CVS TODO.txt package src Parent addContent(int index, Collection collection);
CVS TODO.txt package src List cloneContent();
List getContent(Filter filter);
CVS TODO.txt package src Child getContent(int index);
CVS TODO.txt package src List removeContent();
CVS TODO.txt package src List removeContent(Filter filter);
CVS TODO.txt package src Child removeContent(int index);
boolean removeContent(Child child);
Parent setContent(Child child);
Parent setContent(Collection collection);
CVS TODO.txt package src Parent setContent(int index, Child child);
CVS TODO.txt package src Parent setContent(int index, Collection collection);
Child has methods:
CVS TODO.txt package src String getValue();
Parent is implemented by Document and Element.
Child is implemented by Comment, DocType, Element, EntityRef,
ProcessingInstruction, and Text (CDATA).
The new methods on Parent are pretty self explanatory. A few methods that
used to require List work are now on Parent itself for convenience. The
cloneContent() and removeContent() calls should be especially helpful.
The getValue() method in Child is defined to return the XPath 1.0 string value
of the element. The getText() methods in Element are left unchanged.
A subtle change is that getParent() now returns a Parent type which is its
immediate parent. Previously an item at the document level would return null
and you'd use getDocument() to get its Document.
In a similar vein, the protected setDocument() methods have been removed in
favor of just using setParent(). getDocument() remains as a potentially
recursive lookup method.
I renamed getChildren() to getChildElements() and renamed getChild() to
getChildElement(). Now that there's a real Child interface getChildren() is
even more confusing than it used to be. I deprecated the old forms. This
change will require a lot of recoding for people.
Also updated supporting files to use the new APIs.
Thanks to Brad's jdom-x experimental tree for lots of the ideas in here,
and thanks to Brad for pre-reviewing this change.
File: TODO.txt Status: Up-to-date
Working revision: 1.109 Tue May 20 21:53:44 2003
Repository revision: 1.109 /home/cvs/jdom/TODO.txt,v
jdom_1_0_b9 (revision: 1.101)
jdom_1_0_b8 (revision: 1.93)
jdom_prefilter (revision: 1.84)
jdom_1_0_b7 (revision: 1.77)
jdom_1_0_b6 (revision: 1.51)
start (revision: 126.96.36.199)
jdom (branch: 1.1.1)
More information about the jdom-commits