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

nobody nobody at chimbo.servlets.com
Thu Feb 5 19:39:03 PST 2004


****************************************
Date:   Thu Feb  5, 2004 @20:39:03 MST
Author: 

Update of /home/cvs/jdom/src/java/org/jdom
In directory chimbo:/tmp/cvs-serv2582

Modified Files:
Child.java Comment.java ContentList.java DocType.java
Document.java Element.java EntityRef.java Parent.java
ProcessingInstruction.java Text.java
Log Message:
Integrated a major path from Rolf Lear (rlearATalgorithmics.com).
Below is his 6/4/2003 email. I tagged the code "before_rolf" so
if we decide to back this out it's easy.

-jh-

I have had a look at the Child/Parent thing.

Personally, I don't think the Idea has been taken far enough, so I
played around with the concept, and "normalised" some of the
redundancies.

Firstly, I converted the Child interface into an Abstract class that
deals with ALL Parent/child relationships for the Child role,
including detaching, cloning, set/getParent (and holds the parent
instance field).

I also implemented getDocument at the Child Class level (all children
have the same mechanism for getting the Document).

Next, I added the method "getDocument" to the Parent Interface... and
parent can getDocument, including the Document class which has "return
this;" in the getDocument().

Finally, I changed the ContentList class substantially. elementData is
now called childData, and is of type Child[] instead of Object[]. The
ContentList owner is now of type Parent instead of Object. I have
added a method canContain to the Parent interface, and thus the actual
Parent object determines what content is allowed in the contentlist,
so instead of add(int,Text), add(int,Element), add(int,CDATA),
add(int,ProcessingInstruction), etc, there is just add(int, Child).

In doing all of the above, I have cut large amounts of
redundant/duplicated code, simplified the relationships, and thrown
away "special cases". The only downside I can see in terms of
"functionality" is that some of the exceptions are thrown with less
specialised messages...

Please have a look, and comment on the concept. Note, that this is
only possible by converting Child to an abstract class instead of
an interface.

Rolf

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

   Working revision:	1.4	Fri Feb  6 03:39:02 2004
   Repository revision:	1.4	/home/cvs/jdom/src/java/org/jdom/Child.java,v

   Existing Tags:
	before_rolf              	(revision: 1.3)

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

   Working revision:	1.29	Fri Feb  6 03:39:02 2004
   Repository revision:	1.29	/home/cvs/jdom/src/java/org/jdom/Comment.java,v

   Existing Tags:
	before_rolf              	(revision: 1.28)
	jdom_1_0_b9              	(revision: 1.26)
	jdom_1_0_b8              	(revision: 1.22)
	jdom_prefilter           	(revision: 1.17)
	jdom_1_0_b7              	(revision: 1.17)
	jdom_1_0_b6              	(revision: 1.10)
	start                    	(revision: 1.1.1.1)
	jdom                     	(branch: 1.1.1)

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

   Working revision:	1.32	Fri Feb  6 03:39:03 2004
   Repository revision:	1.32	/home/cvs/jdom/src/java/org/jdom/ContentList.java,v

   Existing Tags:
	before_rolf              	(revision: 1.31)
	jdom_1_0_b9              	(revision: 1.21)
	jdom_1_0_b8              	(revision: 1.11)

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

   Working revision:	1.27	Fri Feb  6 03:39:03 2004
   Repository revision:	1.27	/home/cvs/jdom/src/java/org/jdom/DocType.java,v

   Existing Tags:
	before_rolf              	(revision: 1.26)
	jdom_1_0_b9              	(revision: 1.24)
	jdom_1_0_b8              	(revision: 1.18)
	jdom_prefilter           	(revision: 1.15)
	jdom_1_0_b7              	(revision: 1.14)
	jdom_1_0_b6              	(revision: 1.7)
	start                    	(revision: 1.1.1.1)
	jdom                     	(branch: 1.1.1)

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

   Working revision:	1.75	Fri Feb  6 03:39:03 2004
   Repository revision:	1.75	/home/cvs/jdom/src/java/org/jdom/Document.java,v

   Existing Tags:
	before_rolf              	(revision: 1.74)
	jdom_1_0_b9              	(revision: 1.63)
	jdom_1_0_b8              	(revision: 1.55)
	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.140	Fri Feb  6 03:39:03 2004
   Repository revision:	1.140	/home/cvs/jdom/src/java/org/jdom/Element.java,v

   Existing Tags:
	before_rolf              	(revision: 1.139)
	jdom_1_0_b9              	(revision: 1.130)
	jdom_1_0_b8              	(revision: 1.115)
	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 EntityRef.java		Status: Needs Checkout

   Working revision:	1.17	Fri Feb  6 03:39:03 2004
   Repository revision:	1.17	/home/cvs/jdom/src/java/org/jdom/EntityRef.java,v

   Existing Tags:
	before_rolf              	(revision: 1.16)
	jdom_1_0_b9              	(revision: 1.13)
	jdom_1_0_b8              	(revision: 1.8)
	jdom_prefilter           	(revision: 1.3)
	jdom_1_0_b7              	(revision: 1.3)

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

   Working revision:	1.7	Fri Feb  6 03:39:03 2004
   Repository revision:	1.7	/home/cvs/jdom/src/java/org/jdom/Parent.java,v

   Existing Tags:
	before_rolf              	(revision: 1.6)

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

   Working revision:	1.41	Fri Feb  6 03:39:03 2004
   Repository revision:	1.41	/home/cvs/jdom/src/java/org/jdom/ProcessingInstruction.java,v

   Existing Tags:
	before_rolf              	(revision: 1.40)
	jdom_1_0_b9              	(revision: 1.36)
	jdom_1_0_b8              	(revision: 1.27)
	jdom_prefilter           	(revision: 1.21)
	jdom_1_0_b7              	(revision: 1.20)
	jdom_1_0_b6              	(revision: 1.10)
	start                    	(revision: 1.1.1.1)
	jdom                     	(branch: 1.1.1)

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

   Working revision:	1.19	Fri Feb  6 03:39:03 2004
   Repository revision:	1.19	/home/cvs/jdom/src/java/org/jdom/Text.java,v

   Existing Tags:
	before_rolf              	(revision: 1.18)
	jdom_1_0_b9              	(revision: 1.15)
	jdom_1_0_b8              	(revision: 1.11)
	jdom_prefilter           	(revision: 1.7)
	jdom_1_0_b7              	(revision: 1.7)




More information about the jdom-commits mailing list