[jdom-interest] CDATA as Text subclass?

Ken Rune Helland kenh at csc.no
Mon May 28 07:11:35 PDT 2001

At 08:11 AM 5/28/2001 -0500, philip.nelson at omniresources.com wrote:

> > If the reason for implementing this class is to abstract from
> > the type of
> > string (i.e. character based or unicode) that you are using,
> > do you manage
> > it with this class? It seems to me that it's api still
> > depends on String and
>It is happening primarily to allow developers to be able to make the textual
>content appear as a node in a tree with for example a parent to aid in
>traversal type operations.

By the way, does this mean that CDATA will become a
marker subclass of Text. Seems like a good idea as they are
the same except when outputting.

On the other hand one will have to take care when testing for
types if one need to divide between them as:

if( obj instanceof Text ){...1...}
else if( obj instanceof CDATA ) {...2...}

always will go to block 1.



More information about the jdom-interest mailing list