[jdom-interest] getSerializedForm() [eg]

Joseph Bowbeer jozart at csi.com
Tue Apr 24 16:41:08 PDT 2001

jh writes:

> 1. Remove getSerializedForm() and have toString() output
>  something non-XML like "[ProcessingInstruction: target: pi data: data]"
> * No dependencies in org.jdom on org.jdom.output
> * But ugly toString()
> * Ugly new XMLOutputter.outputString(elt) instead of
>   elt.getSerializedForm()

+1 on #1

The argument for deprecating getSF is that it relies on context that ought
to be maintained in an outputter?  I'll buy that: if the user wants to get a
nice XML representation, they should use an outputter.

I don't think toString should be using getSerializedForm, so there's no
reason not to deprecate getSF.

toString is mostly for debugging.  The implementation should represent all
useful internal state, not just what happens to have an XML form.

The [Foo: bar=baz] form is fairly typical.  Subclassers are encouraged to
override it in order to display any additional state they add.

Joe Bowbeer

More information about the jdom-interest mailing list