Skip to Content.
Sympa Menu

xom-interest - Re: [XOM-interest] Subclassing and check methods

xom-interest AT lists.ibiblio.org

Subject: XOM API for Processing XML with Java

List archive

Chronological Thread  
  • From: "Bradley S. Huffman" <hip AT cs.okstate.edu>
  • To: Elliotte Rusty Harold <elharo AT metalab.unc.edu>
  • Cc: xom-interest AT lists.ibiblio.org
  • Subject: Re: [XOM-interest] Subclassing and check methods
  • Date: Thu, 11 Mar 2004 23:21:28 -0600

Elliotte Rusty Harold writes:

> The fields can still be private. However the accessor/mutator methods
> don't have to be final. They can call the superclass methods to make
> their changes. As long as the fields remain private and the accessor
> methods are final, this would not enable anyone to violate the
> fundamental class invariant of well-formedness. Subclasses could
> override insertChild, setLocalName, etc. without being able to bypass
> the well-formedness checks.

Unless they do

private String myLocalName;

public void setLocalName(String localName) {
myLocalName = localName;
}

public String getLocalName() {
return myLocalName;
}

Brad




Archive powered by MHonArc 2.6.24.

Top of Page