[jdom-interest] First impressions and some suggestions

Patrick Dowler Patrick.Dowler at nrc.ca
Fri Jun 2 10:56:44 PDT 2000


On Fri, 02 Jun 2000, bob wrote:
> > other names are welcome.  getContentRaw() is the best I've come up with
> > but don't really like it.  getRawContent()?  getUntrimmedContent()? 
> > Hmm...
> 
> 	Not to throw yet-another 'me too' on the stack, but
> 	I'd personally prefer getContent() to return the content,
> 	as defined by the XML spec.  That just seems to be
> 	what 'get content' means to me.  No adjectives, no
> 	molestation of the content.
> 
> 	Iff it's decreed that getContent() returns the trimmed
> 	content, then instead of getRawContent() to return the
> 	full content, including surrounding whitespace, I kinda
> 	like the name getFullContent().  There's nothing particularly
> 	'raw' about the content with spaces around it.  'Raw', to
> 	me, means that things like entities aren't expanded,
> 	etc.  (just a bundle of bytes, not unlike the CDATA
> 	we're going around about).

A previous post suggested getContentRaw: it doesn't read nicely and is not
consistent with standard naming style (or any other comfortable one, for that
matter), and certainlky not consistent with other Element methods. (-3)

Currently, Element supports getXXXContent for XXX == primitive types, which is
very handy, so the style appears to get that getContent does the standard
thing (String) and getXXXContent does something special. The dispute  
at this point is whether standard == "common use" or standard == "default XML". 
Since JDOM is supposed to be easy to do the common stuff, I think the answer
is that getContent is common rather than default.

So, we need another getXXXContent to do the default thing:

	getRawContent ?
	getFullContent ?
	getDefaultContent ? 
	getDefaultXMLContentWithAllTheWhiteSpaceIntact? :-)

--	

Patrick Dowler
Canadian Astronomy Data Centre




More information about the jdom-interest mailing list