[jdom-interest] Text class in the api

Alex Rosen arosen at silverstream.com
Wed Oct 24 07:52:26 PDT 2001

> > One thing is I remember a post about not wanting to force
> > anyone to use
> > Text class if they didn't want to, I however think it should be one
> > way or the other, either Element.content has only Text or
> > only String for
> > textual content, but not both.
> The intent was to keep all the String based methods.  These
> strings would be
> kept in the content List of Element inside Text objects.  We
> would provide
> methods to directly add Text nodes to an element's content
> and inside the
> list, there would not be any Strings.

I'd say this a little differently - an Element has Text nodes, not String
nodes. But we will keep the convenience methods that can return the
Element's value as a String, concatenating all the characters from all its
Text nodes together. So get*Text*() and setText() stay, but
addContent(String) and removeContent(String) are replaced by Text versions.


More information about the jdom-interest mailing list