[jdom-interest] NoSuch*Exceptions in JDOM
Andre Van Delft
avandelft at epo.org
Mon Jul 10 05:29:44 PDT 2000
Alex Chaffee wrote:
> > We can have it both ways.
> > I use a util function getChild that returns a null if the child is
> > absent.
> > I prefer the Element.getChild function to behave like this.
> > The old Element.getChild functions throwing the exceptions may well be
> > renamed into mustGetChild.
> > That would do, IMHO.
> I'm with you. I like the terminology "mustX", but that breaks the
> JavaBean convention of starting accesors with "get". But I think null
> should be returned by the standard methods; Cornell&Horstmann (and
> others) taught me not to overuse exceptions where a compare will do.
Would the JavaBean convention forbid "mustGetChild"
even if there is already a "getChild"?
getMandatoryChild - may throw NoSuch*Exception
getOptionalChild - may return null
More information about the jdom-interest