Skip to Content.
Sympa Menu

xom-interest - Re: [XOM-interest] Recursion

xom-interest AT lists.ibiblio.org

Subject: XOM API for Processing XML with Java

List archive

Chronological Thread  
  • From: John Cowan <cowan AT ccil.org>
  • To: Elliotte Rusty Harold <elharo AT metalab.unc.edu>
  • Cc: xom-interest AT lists.ibiblio.org
  • Subject: Re: [XOM-interest] Recursion
  • Date: Tue, 9 Mar 2004 22:48:15 -0500

Elliotte Rusty Harold scripsit:

> How much nesting would typically be required to expose this?

Good question: I have no clue. But if you have gobs of threads,
there won't be nearly as much stack.

> >A way to avoid the API wart would be to check if the element to be copied
> >is an actual Element or a subclass, and in the latter case, using
> >sourceElement.getClass().newInstance() to call the argless constructor.
>
> But the subclass may not have a no-args constructor.

Fair enough; Element doesn't, after all. You could use reflection to
look for the constructor with a single String argument, though, and
blow chunks if there isn't one.

--
John Cowan jcowan AT reutershealth.com www.reutershealth.com
www.ccil.org/~cowan
Heckler: "Go on, Al, tell 'em all you know. It won't take long."
Al Smith: "I'll tell 'em all we *both* know. It won't take any longer."




Archive powered by MHonArc 2.6.24.

Top of Page