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

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

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

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

Modified Files:
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


File: no file SAXHandler.java		Status: Needs Checkout

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

   Existing Tags:
	BEFORE_UNCHECKED         	(revision: 1.66)
	jdom_1_0_b10             	(revision: 1.64)
	jdom_1_0_b10_rc1         	(revision: 1.64)
	after_rolf               	(revision: 1.61)
	before_rolf              	(revision: 1.61)
	jdom_1_0_b9              	(revision: 1.50)
	jdom_1_0_b8              	(revision: 1.39)
	jdom_prefilter           	(revision: 1.27)
	jdom_1_0_b7              	(revision: 1.18)

More information about the jdom-commits mailing list