[jdom-interest] Factories for builders.

Richard Cook rpc at prismtechnologies.com
Sun Mar 11 01:50:18 PST 2001


This is kind of why when I wanted similar functionality I added SAXHandler
param. to SAXBuilder constructors, and template createElement()/Attribute()
methods to SAXHandler. I was hoping it would mean essentially any JDom <-
SAX construction could be customised, such as filtering elements out and
possibly processing document fragments during the build process, because you
can override startElement() etc.

But my reason for doing this went away so I have compiled but untested code.
I could test & post it but I doubt its of general interest and I'd have to
"unvisualage" it first :(


Richard


> -----Original Message-----
> From: jdom-interest-admin at jdom.org
> [mailto:jdom-interest-admin at jdom.org]On Behalf Of Steven D. Keens
> Sent: Friday, March 09, 2001 6:35 PM
> To: jdom-interest at jdom.org
> Subject: RE: [jdom-interest] Factories for builders.
>
>
> Will it be only building Elements?  What about attributes,
> processing instructions, and all of the other XML objects?
> I don't think we should call it an ElementFactory.  I
> think maybe XMLFactory or something else.
>
> -----Original Message-----
> From: jdom-interest-admin at jdom.org
> [mailto:jdom-interest-admin at jdom.org]On Behalf Of Paul Philion
> Sent: Friday, March 09, 2001 12:29
> To: jdom-interest at jdom.org
> Subject: RE: [jdom-interest] Factories for builders.
>
>
> Ken -
>
> I always prefer an interface (call it ElementFactory, for example) and a
> default implementation (DefaultElementFactory). SaxBuilder could
> have either
> a setElementFactory or an additional set of constructors (each having an
> extra parameters: ElementFactory). Typical behavior would be to subclass
> DefaultElementFactory and override the specific behaviors that you need.
>
> - Paul Philion
>
> > -----Original Message-----
> > From: jdom-interest-admin at jdom.org
> > [mailto:jdom-interest-admin at jdom.org]On Behalf Of Ken Rune Helland
> > Sent: Friday, March 09, 2001 12:14 PM
> > To: jdom-interest
> > Subject: [jdom-interest] Factories for builders.
> >
> >
> > Hello all.
> >
> > On monday I will rewrite SaxBuilder to
> > accept a factory to enable building of JDom
> > trees with subclasses of the JDOM classes.
> > I will of course post the modified SaxBuilder
> > to the project for evaluation for inclusion
> > into the main code.
> >
> > My current plan is to create an interface with
> > methods matching the public constructors of the
> > jdom classes and supply SaxBuilder with a default
> > implementation that serves the original JDOM
> > classes.
> >
> > Does anyone have any ideas and suggestions for
> > a better approach?
> >
> > Especially am I wondering if the Factory should be
> > a class or interface, is there any pros and cons?
> >
> >
> > Best Regards
> > KenR
> >
> > _______________________________________________
> > To control your jdom-interest membership:
> > http://lists.denveronline.net/mailman/options/jdom-interest/yourad
> > dr at yourhost.com
> >
> >
>
> _______________________________________________
> To control your jdom-interest membership:
> http://lists.denveronline.net/mailman/options/jdom-interest/yourad
dr at yourhos
t.com

_______________________________________________
To control your jdom-interest membership:
http://lists.denveronline.net/mailman/options/jdom-interest/youraddr@yourhos
t.com




More information about the jdom-interest mailing list