[jdom-interest] wrong error msg
Jason Hunter
jhunter at acm.org
Thu Nov 8 10:45:17 PST 2001
> Comment and ProcessingInstruction appear to have duplicated code in
> addContent() at least, if there were an interface (terrible names follow) they
> both implemented you could remove the duplicated code, eg:
>
> interface Addable {
> String getName(); // "PI" or "Comment" for err msgs
> Element getParent();
> Document getDocument();
> }
Then I could make my Widget class implement Addable and have Widgets
hanging all over my document. That's the problem with using typed
interfaces to enforce rules, it lets you create non-well-formed XML.
-jh-
More information about the jdom-interest
mailing list