[jdom-interest] Deprication warnings

Brett McLaughlin brett.mclaughlin at lutris.com
Mon Oct 9 15:53:38 PDT 2000


Jay Di Silvestri wrote:
> 
> I'm sure that I'm doing something stoopid . . but I can't figure out what.
> I'm getting The following errors  (addChild depricated, see below.)  I don't
> follow this list as much as I should, but I looked around the javadocs and I
> didn't see that addchild was depricated.  I looked for "setChild" and didn't
> see that.  The only thing I found was "setChildren", but I'm guessing that I
> don't need to get a list of all the Children each time just so I can add
> one.  Any ideas on where I went wrong?

Use addContent(). addChild() went deprecated in beta 5...

Thanks,
Brett

> 
> Errors
> wordConfig.java:540: Note: The method org.jdom.Element
> addChild(org.jdom.Element) in class org.jdom.Element has been deprecated.
>            parent.addChild(newkid);
>                           ^
> wordConfig.java:571: Note: The method org.jdom.Element
> addChild(org.jdom.Element) in class org.jdom.Element has been deprecated.
>            parent.addChild(newkid);
>                           ^
> wordConfig.java:625: Note: The method org.jdom.Element
> addChild(org.jdom.Element) in class org.jdom.Element has been deprecated.
>            parent.addChild(newpop);
>                           ^
> wordConfig.java:635: Note: The method org.jdom.Element
> addChild(org.jdom.Element) in class org.jdom.Element has been deprecated.
>               newpop.addChild(newkid);
>                              ^
> Note: wordConfig.java uses or overrides a deprecated API.  Please consult
> the documentation for a better alternative.
> 1 warning
> code
>    public void  javasub (String param, Element parent )
>    {
>      if (param.equalsIgnoreCase("content_type")){
>       readTable atable=new readTable();
>         try {
>            ArrayList contab=atable.parseTable(this.topdir+"/tables/contentty
> pe_table");
>           ListIterator iter= contab.listIterator();
>           while (iter.hasNext()) {
>            this.controlint++;
>            ArrayList row =(ArrayList) iter.next();
>            Element newkid=new Element("button");
>            newkid.addAttribute("control",control+this.controlint);
>            newkid.addAttribute("name",(String)row.get(1));
>            newkid.addAttribute("class",(String)row.get(1));
>            parent.addChild(newkid);
> [ . . .]
> Jay Di Silvestri
> Executive Vice President
> Advanced Data Engineering
> 1310 Redwood Way, Suite 120
> Petaluma, CA 94954
> jay at adei.com
> 
> _______________________________________________
> To control your jdom-interest membership:
> http://lists.denveronline.net/mailman/options/jdom-interest/youraddr@yourhost.com

-- 
Brett McLaughlin, Enhydra Strategist
Lutris Technologies, Inc. 
1200 Pacific Avenue, Suite 300 
Santa Cruz, CA 95060 USA 
http://www.lutris.com
http://www.enhydra.org



More information about the jdom-interest mailing list