Skip to Content.
Sympa Menu

xom-interest - Re: [XOM-interest] Node.query final

xom-interest AT lists.ibiblio.org

Subject: XOM API for Processing XML with Java

List archive

Chronological Thread  
  • From: "Blaine R Southam" <bsoutham AT gmail.com>
  • To: xom-interest AT lists.ibiblio.org
  • Subject: Re: [XOM-interest] Node.query final
  • Date: Mon, 18 Sep 2006 21:34:43 -0600

I guess my point was, that if Node.query wasn't final, I could implement the
functionality I wanted, but subclassing Element (and modifying the behavior
of a single constructor), and subclassing Node, and overriding the
query(string) method. This would work if Node.query wasn't final. I'm not
entirely sure why it is final. It doesn't seem that it would be harmful to
allow the method to be overriden. I can see a possible argument for making
query(String, XPathContext) final - but I'm not seeing the benefit of making
the other query method final.

I know that I can construct a class with "myQuery" method on it. But then
it will be confusing to the user. There is a Node.query - but Don't use
it. Use NewClas.myQuery" intead. Or if I create a "myQuery" method on my
own subclassed node, I still have the same problem.

I don't see the harm removing the "final" declaration from the
Node.query(string)
method. Am I missing something (which is entierly possible)?

Thanks,
-Blaine


On 9/18/06, Elliotte Harold <elharo AT metalab.unc.edu> wrote:

Blaine R Southam wrote:
mespaces are messed up - which is part of why I'm trying to remove
> them from my user interaction. Since I'm only going to deal with a
single
> namespace I'm not sure why this would be a problem.

Because otherwise XPath would break pretty badly.


> So I guess my question is, without overriding Node.query(string), is
there
> another way to "default" my namespace handling?

Sure. Just don't name your custom method query. Call it defaultQuery or
sear5ch or some such.

--
Elliotte Rusty Harold elharo AT metalab.unc.edu
Java I/O 2nd Edition Just Published!
http://www.cafeaulait.org/books/javaio2/
http://www.amazon.com/exec/obidos/ISBN=0596527500/ref=nosim/cafeaulaitA/





Archive powered by MHonArc 2.6.24.

Top of Page