xom-interest AT lists.ibiblio.org
Subject: XOM API for Processing XML with Java
List archive
- From: jcowan AT reutershealth.com
- To: "Bradley S. Huffman" <hip AT cs.okstate.edu>
- Cc: xom-interest AT lists.ibiblio.org
- Subject: Re: [XOM-interest] Subclassing and check methods
- Date: Fri, 12 Mar 2004 11:12:20 -0500
Bradley S. Huffman scripsit:
> If I subclass Element and override checkInsertChild to check that elements
> with local name "foo" can only contain children with local name "bar", what
> do I do about setLocalName? Think about the case of replacing nodes in a
> document. Obviously I can create a "foo" element by recycling a existing
> element and using setLocalName, skipping the checks in checkInsertChild
> completely.
In ERH's brave new world, the check* methods are gone and you impose
the constraint by overriding setLocalName as well as insertChild, and
throw if someone tries to violate the constraint.
That reminds me. As part of this effort, the throwables for these
protected mutator methods should be broadened to XMLException.
(I know the clause has no actual effect on the compiler, but it's good
documentation to get it right.) I'd rather throw the same exception
from setLocalName and insertChild in this case (an IllegalAddException
or a new subclass of it), but currently setLocalName is (documented as)
only throwing IllegalNameException.
--
Samuel Johnson on playing the violin: John Cowan
"Difficult do you call it, Sir? jcowan AT reutershealth.com
I wish it were impossible." http://www.ccil.org/~cowan
-
[XOM-interest] Last call warning,
Elliotte Harold, 03/11/2004
-
Re: [XOM-interest] Last call warning,
jcowan, 03/11/2004
-
[XOM-interest] Subclassing and check methods,
Elliotte Rusty Harold, 03/11/2004
-
Re: [XOM-interest] Subclassing and check methods,
Bradley S. Huffman, 03/12/2004
- Re: [XOM-interest] Subclassing and check methods, Bradley S. Huffman, 03/12/2004
-
Re: [XOM-interest] Subclassing and check methods,
Elliotte Rusty Harold, 03/12/2004
-
Re: [XOM-interest] Subclassing and check methods,
Bradley S. Huffman, 03/12/2004
- Re: [XOM-interest] Subclassing and check methods, Elliotte Rusty Harold, 03/12/2004
- Re: [XOM-interest] Subclassing and check methods, Elliotte Rusty Harold, 03/12/2004
-
Re: [XOM-interest] Subclassing and check methods,
jcowan, 03/12/2004
- Re: [XOM-interest] Subclassing and check methods, Elliotte Rusty Harold, 03/13/2004
- Re: [XOM-interest] Subclassing and check methods, John Cowan, 03/13/2004
-
Re: [XOM-interest] Subclassing and check methods,
Bradley S. Huffman, 03/12/2004
-
Re: [XOM-interest] Subclassing and check methods,
Bradley S. Huffman, 03/12/2004
-
Re: [XOM-interest] Subclassing and check methods,
Elliotte Rusty Harold, 03/12/2004
- Re: [XOM-interest] Subclassing and check methods, Bradley S. Huffman, 03/12/2004
-
Re: [XOM-interest] Subclassing and check methods,
John Cowan, 03/12/2004
- Re: [XOM-interest] Subclassing and check methods, Elliotte Rusty Harold, 03/13/2004
-
[XOM-interest] Subclassing and check methods,
Elliotte Rusty Harold, 03/11/2004
-
Re: [XOM-interest] Last call warning,
Elliotte Rusty Harold, 03/13/2004
- Re: [XOM-interest] Last call warning, John Cowan, 03/13/2004
-
Re: [XOM-interest] Last call warning,
jcowan, 03/11/2004
Archive powered by MHonArc 2.6.24.