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

nobody nobody at chimbo.servlets.com
Fri Feb 27 19:30:27 PST 2004


****************************************
Date:   Fri Feb 27, 2004 @20:30:27 MST
Author: 

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

Modified Files:
AttributeList.java ContentList.java DefaultJDOMFactory.java
JDOMFactory.java
Added Files:
UncheckedJDOMFactory.java
Log Message:
Added an UncheckedJDOMFactory class which builds without doing any
content or structure checks, letting you gain speed in a situation
where you have 100% confidence in your parser. The Javadocs for
the class naturally includes a serious warning.

It's not used by default, but you can select it with a
builder.setFactory(new UncheckedJDOMFactory()) call.

I also added to JDOMFactory a few methods:
addContent(Parent, Content)
setAttribute(Element, Attribute)
addNamespaceDeclaration(Element, Namespace)

These are called during the build to do the adds. The default builder
just calls parent.addContent(Content) while the "unchecked" factory does
the work without checks using package protected methods on ContentList
and AttributeList.

A perk of having these methods in the factory and used by the builder
is you can write a custom factory to do certain things during the adds.
Like you could ignore all elements named "foo" by not doing the add if
the Content was an Elt foo. That's not perfect since the elements
underneath foo would still be built into a subtree that got ignored,
but it's an easy solution to save memory in the resulting document.

Tagged the distribution as BEFORE_UNCHECKED since this is a significant
change we might want to back out.

Thanks to Philippe Riand at Trilog for starter code I used to build this.
His code (mailed to the list) required several new classes, and I changed
that to the pluggable factory model.

I'll ask Phil to test this change using his Win32 library that gets CPU
time.

-jh-

===================================================================
File: UncheckedJDOMFactory.java	Status: Up-to-date

   Working revision:	1.1	Sat Feb 28 03:30:27 2004
   Repository revision:	1.1	/home/cvs/jdom/src/java/org/jdom/UncheckedJDOMFactory.java,v

   Existing Tags:
	No Tags Exist

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

   Working revision:	1.23	Sat Feb 28 03:30:27 2004
   Repository revision:	1.23	/home/cvs/jdom/src/java/org/jdom/AttributeList.java,v

   Existing Tags:
	BEFORE_UNCHECKED         	(revision: 1.22)
	jdom_1_0_b10             	(revision: 1.21)
	jdom_1_0_b10_rc1         	(revision: 1.21)
	after_rolf               	(revision: 1.20)
	before_rolf              	(revision: 1.20)
	jdom_1_0_b9              	(revision: 1.16)
	jdom_1_0_b8              	(revision: 1.8)

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

   Working revision:	1.39	Sat Feb 28 03:30:27 2004
   Repository revision:	1.39	/home/cvs/jdom/src/java/org/jdom/ContentList.java,v

   Existing Tags:
	BEFORE_UNCHECKED         	(revision: 1.38)
	jdom_1_0_b10             	(revision: 1.36)
	jdom_1_0_b10_rc1         	(revision: 1.34)
	after_rolf               	(revision: 1.32)
	before_rolf              	(revision: 1.31)
	jdom_1_0_b9              	(revision: 1.21)
	jdom_1_0_b8              	(revision: 1.11)

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

   Working revision:	1.4	Sat Feb 28 03:30:27 2004
   Repository revision:	1.4	/home/cvs/jdom/src/java/org/jdom/DefaultJDOMFactory.java,v

   Existing Tags:
	BEFORE_UNCHECKED         	(revision: 1.3)
	jdom_1_0_b10             	(revision: 1.2)
	jdom_1_0_b10_rc1         	(revision: 1.2)

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

   Working revision:	1.4	Sat Feb 28 03:30:27 2004
   Repository revision:	1.4	/home/cvs/jdom/src/java/org/jdom/JDOMFactory.java,v

   Existing Tags:
	BEFORE_UNCHECKED         	(revision: 1.3)
	jdom_1_0_b10             	(revision: 1.2)
	jdom_1_0_b10_rc1         	(revision: 1.2)




More information about the jdom-commits mailing list