[jdom-interest] Factories for builders.

Jan Peter Hecking jan at netgaroo.com
Tue Mar 13 08:02:33 PST 2001


On Mon, Mar 05, 2001 at 11:08:36 +0100, Laurent Bihanic wrote:
> Please find attached an attempt to implement JAXP 1.1 TRaX source
> (JDOMSource) and result (JDOMResult) wrapping JDOM Documents.
> These classes have been (lightly) tested with Xalan 2.0.0 and so
> far are OK.

On Tue, Mar 13, 2001 at 01:39:03PM +0100, Ken Rune Helland wrote:
> Here is an attemt to implement factories for builders.

Here's a patch to Laurents above mentioned JDOMResult class to use the
JDOMFactory interface provided by Ken.

bye,
Jan

-- 
Jan Peter Hecking                  jhecking at netgaroo.com
University of Rostock     Department of Computer Science
Homepage: http://www.informatik.uni-rostock.de/~jhecking
-------------- next part --------------
99c99
<     * Default empty contructor.
---
>     * Default empty constructor.
110a111,125
>    /**
>     * Constructor that uses a custom JDOMFactory for the DocumentBuilder.
>     * Use this to build the result tree with your own subclasses of the
>     * JDOM classes.
>     */
>    public JDOMResult(JDOMFactory customFactory)
>    {
>       super();
> 
>       this.documentBuilder = new DocumentBuilder(customFactory);
> 
>       super.setHandler(this.documentBuilder);
>       super.setLexicalHandler(this.documentBuilder);
>    }
> 
199a215,219
>       /**
>        * The factory for creating new JDOM objects.
>        */
>       private JDOMFactory factory = new DefaultJDOMFactory();
> 
213a234,244
>       /**
>        * Constructor that uses a custom JDOMFactory for the DocumentBuilder.
>        * Use this to build the result tree with your own subclasses of the
>        * JDOM classes.
>        */
>       DocumentBuilder(JDOMFactory customFactory)
>       {
>          super();
>          factory = customFactory;
>       }
> 
234,235c265,266
<             this.resultDocument = new Document(null);
<             this.saxHandler     = new SAXHandler(this.resultDocument);
---
>             this.resultDocument = factory.document(null);
>             this.saxHandler     = new SAXHandler(this.resultDocument,factory);


More information about the jdom-interest mailing list