[jdom-commits] CVS update: jdom/src/java/org/jdom

cvs at jools.org cvs at jools.org
Fri Jan 25 10:42:52 PST 2002


Date:	Friday January 25, 2002 @ 13:42
Author:	cvs

Update of /home/cvspublic/jdom/src/java/org/jdom
In directory jools.org:/tmp/cvs-serv5717

Modified Files:
	Document.java Element.java ElementFilter.java Filter.java 
	Verifier.java 
Added Files:
	AttributeList.java ContentList.java 
Removed Files:
	AttributeFilter.java DocumentContentFilter.java 
	ElementContentFilter.java FilterList.java 
Log Message:
Integrating two large sets of patches from Brad Huffman.  Here's
the first patch set, in his words:

--
I finished working on a version that uses a AttributeList and ContentList
that phil suggested (and alex seemed to like).

     ftp://a.cs.okstate.edu/pub/hip/jdom-filter-v2.zip

While no blazing speed improvements, it did make the code smaller and a lot
easier to understand.

To summarize:
   1. AttributeList is a extension of AbstractList for holding attributes.
      It contains all the verifications and checks (namespace, duplicates).
   2. ContentList is a extension of AbstractList for holding Element or 
      Document content (depending on the constructor).
      It also contains all the verifications and checks (including a single
      root element).
   3. Both maintain the contact that a failure leaves things unchanged.
   4. Both use a ArrayList as a backing list, but it is not created
      until the first call to add(Object). 
   5. The above implies no need for attributeCount(), nodeCount(),
      getAttribute(int), getContent(int),  since getAttributes() and 
      getContent() don't create content.
   6. FilterList is now also extension of AbstractList.  The constructors
      are FilterList(List,Filter), FilterList(List,Comparator), 
      FilterList(List,Filter,Comparator). 
   7. Filter now only needs 3 methods - canAdd(Object), canRemove(Object),
      matches(Object).
   8. FilterList, Filter, ElementFilter are moved to org.jdom.filter since
      one doesn't need to know to use JDOM core.

Personally, I was sceptical at first, but I do like this incarnation the
best. It a lot easier to understand and just as fast as what's currently
in the repository.
--

Here's the follow-on patch set, again in his words:

--
Okay, here hopefully is the final incarnation.  It should address most
of everyones concerns from last time.

     ftp://a.cs.okstate.edu/pub/hip/jdom-filter-v3.zip

Changes since last time:
     1. FilterList and FilterListIterator moved inner to classes of
        ContentList giving them access to it's instance variables
        for future optimizations.
     2. Remove unused methods from AttributeList and ContentList.
     3. Made sure all Exceptions have a useful message.
     4. Class protected AttributeList, ContentList, etc.
--

Here's my high-level summary of the public API change.  This'll be handy
for the CHANGES file:
* Added ability for a Document to have a detached root, with an ISE
  thrown in case of read from such a Document.
* Added a public method Document.detachRootElement()
* Limited the public Filter-related classes to just Filter.
* XMLOutputter now has a Format inner class
* XMLOutputter has changed the escape*() methods to be public
* XMLOutputter has added the following public methods:
    outputString(List list)
    outputString(String str)
    outputString(Text text)
    output(List list, OutputStream out)
    output(List list, Writer out)

Last notes:
* No getContent(Filter) method is yet exposed.
* The org.jdom.filter package will not need to be used afterall.
* I fixed a few little issues (mostly Javadoc) I found in the code 
  and did some whitespace reformatting.

A few of the jdom-test cases now fail, but most appear to have a good
explanation.  Specifically, handling null parameters is a little 
different now.  Hopefully the author (Phil?) can verify my reading.

The code seems to work on a few tiny little real-life tests, but it's 2:37am
and I'm not doing any more tonight.  There's a lot of changes in this check-in 
so keep your eyes open and please report anything unusual you notice!

And thanks, Brad!

-jh-

===================================================================
File: no file AttributeList.java		Status: Needs Checkout

   Working revision:	1.1	Fri Jan 25 18:42:52 2002
   Repository revision:	1.1	/home/cvspublic/jdom/src/java/org/jdom/AttributeList.java,v

   Existing Tags:
	No Tags Exist

===================================================================
File: no file ContentList.java		Status: Needs Checkout

   Working revision:	1.1	Fri Jan 25 18:42:52 2002
   Repository revision:	1.1	/home/cvspublic/jdom/src/java/org/jdom/ContentList.java,v

   Existing Tags:
	No Tags Exist

===================================================================
File: no file Document.java		Status: Needs Checkout

   Working revision:	1.50	Fri Jan 25 18:42:52 2002
   Repository revision:	1.50	/home/cvspublic/jdom/src/java/org/jdom/Document.java,v

   Existing Tags:
	jdom_prefilter           	(revision: 1.47)
	jdom_1_0_b7              	(revision: 1.44)
	jdom_1_0_b6              	(revision: 1.25)
	start                    	(revision: 1.1.1.1)
	jdom                     	(branch: 1.1.1)

===================================================================
File: no file Element.java		Status: Needs Checkout

   Working revision:	1.106	Fri Jan 25 18:42:52 2002
   Repository revision:	1.106	/home/cvspublic/jdom/src/java/org/jdom/Element.java,v

   Existing Tags:
	jdom_prefilter           	(revision: 1.102)
	jdom_1_0_b7              	(revision: 1.96)
	jdom_1_0_b6              	(revision: 1.52)
	start                    	(revision: 1.1.1.1)
	jdom                     	(branch: 1.1.1)

===================================================================
File: no file ElementFilter.java		Status: Needs Checkout

   Working revision:	1.3	Fri Jan 25 18:42:52 2002
   Repository revision:	1.3	/home/cvspublic/jdom/src/java/org/jdom/ElementFilter.java,v

   Existing Tags:
	No Tags Exist

===================================================================
File: no file Filter.java		Status: Needs Checkout

   Working revision:	1.3	Fri Jan 25 18:42:52 2002
   Repository revision:	1.3	/home/cvspublic/jdom/src/java/org/jdom/Filter.java,v

   Existing Tags:
	No Tags Exist

===================================================================
File: no file Verifier.java		Status: Needs Checkout

   Working revision:	1.27	Fri Jan 25 18:42:52 2002
   Repository revision:	1.27	/home/cvspublic/jdom/src/java/org/jdom/Verifier.java,v

   Existing Tags:
	jdom_prefilter           	(revision: 1.23)
	jdom_1_0_b7              	(revision: 1.23)
	jdom_1_0_b6              	(revision: 1.19)
	start                    	(revision: 1.1.1.1)
	jdom                     	(branch: 1.1.1)

===================================================================
File: no file AttributeFilter.java		Status: Up-to-date

   Working revision:	No entry for AttributeFilter.java
   Repository revision:	1.4	/home/cvspublic/jdom/src/java/org/jdom/Attic/AttributeFilter.java,v

   Existing Tags:
	No Tags Exist

===================================================================
File: no file DocumentContentFilter.java		Status: Up-to-date

   Working revision:	No entry for DocumentContentFilter.java
   Repository revision:	1.3	/home/cvspublic/jdom/src/java/org/jdom/Attic/DocumentContentFilter.java,v

   Existing Tags:
	No Tags Exist

===================================================================
File: no file ElementContentFilter.java		Status: Up-to-date

   Working revision:	No entry for ElementContentFilter.java
   Repository revision:	1.5	/home/cvspublic/jdom/src/java/org/jdom/Attic/ElementContentFilter.java,v

   Existing Tags:
	No Tags Exist

===================================================================
File: no file FilterList.java		Status: Up-to-date

   Working revision:	No entry for FilterList.java
   Repository revision:	1.4	/home/cvspublic/jdom/src/java/org/jdom/Attic/FilterList.java,v

   Existing Tags:
	No Tags Exist




More information about the jdom-commits mailing list