[jdom-interest] Thoughts on...

Jochen Kirn J.Kirn at gmx.de
Thu Mar 15 11:05:32 PST 2001


> 	Element.addContent (Object obj);
> 	Element.addContent (int val);
> 	Element.addContent (long val);
> 	Element.addContent (char val);
> 	Element.addContent (float val);
> 	Element.addContent (double val);
> 	Element.addContent (boolean val);
> 	Element.addContent (char[] vals);
for primitive types you can write
Element.addContent("" + primitiveValue); // int, double, boolean, ...

> In other words have it similar to how PrintStream works.  Currently I have
> to convert all my values myself, which is a pain.
to prepend a empty String ("") isn't much pain i think ;-)
imho your suggestion would unnecessarily boast the JDOM-API.
> All those methods would have to do is generate the string equivalent of
> the value passed in, in other words they would be the same as
sure, but those methods would only fit to a certain String-represtation
eg. the project i'm using jdom in, i need to have control of that 
represtation.

> 	myelement.addContent (System.currentTimeMillis ());
 try:  myelement.addContent ("" + System.currentTimeMillis ());
 and you are done :-)

> Also, a really useful thing would be to have a method for adding
> StringBuffers as well...
 StringBuffer.toString() ?! 

sers,
Jochen

-- 
Sent through GMX FreeMail - http://www.gmx.net



More information about the jdom-interest mailing list