[jdom-interest] API suggestion

Charlie Wu charwu at cisco.com
Thu Dec 28 12:22:54 PST 2000


But you still have to have the setText() method so that you can update the text
attribute of an existing element.. I'd rather not see so many "convenience" methods
in the core API.. why not just write your own utility class if you need it..

Just my 2 cents

Charlie
  ----- Original Message ----- 
  From: Mike Jennings 
  To: jdom-interest at jdom.org 
  Sent: Thursday, December 28, 2000 11:11 AM
  Subject: [jdom-interest] API suggestion



  What about a factory method in org.jdom.Element that creates an element and sets its
  text all in one go.

  public static Element createElement(String name,String text)
   {
    Element e=new Element(name);
    e.setText(text);
    return e;
   }


  Then, one could replace code that looks like the following:

  Element e=new Element("somename").setText("somevalue");

  with

  Element e=Element.createElement("somename","somevalue");

  Basically just as a convenience method for programmers that need to create a lot of
  elements with text but no attributes.


  Comments?
  -Mike Jennings

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://jdom.org/pipermail/jdom-interest/attachments/20001228/2f7cb521/attachment.htm


More information about the jdom-interest mailing list