[jdom-interest] setAttribute signatures for beta 7

Jason Hunter jhunter at collab.net
Sun Jun 24 23:06:44 PDT 2001


Agreed.

-jh-

philip.nelson at omniresources.com wrote:
> 
> I would like to see one addition *before* beta 7 is released.  Deprecating
> addAttribute is no big deal but having to change all of your addAttribute
> calls that were originally defined as
> addAttribute(String, String)
> or
> addAttribute(String, String, Namespace)
> 
> is a real pain.  We really should have the convienence methods
> setAttribute(String name, String value)
> and
> setAttribute(String name, String value, Namespace ns)
> 
> Then changing to setAttribute is a simple search and replace operation.  In
> addtition, the api is really better with these methods.  The simple case of
> adding an attribute to an element should be no more involved than
> specifiying the name and value or optional namespace.
> 
>     /**
>      * <p>
>      * Convienience method to add an attribute to this element
>      * with the given name and value.
>      * </p>
>      *
>      * @param name name of the attribute to add
>      * @param value value of the attribute to add
>      * @return this element modified
>      */
>     public Element setAttribute(String name, String value) {
>         return setAttribute(new Attribute(name, value));
>     }
> 
>     /**
>      * <p>
>      * Convienience method to add an attribute to this element
>      * with the given name, value and namespace.
>      * </p>
>      *
>      * @param name name of the attribute to add
>      * @param value value of the attribute to add
>      * @param ns Namespace of the attribute to add
>      * @return this element modified
>      */
>     public Element setAttribute(String name, String value, Namespace ns) {
>         return setAttribute(new Attribute(name, value, ns));
>     }
> _______________________________________________
> To control your jdom-interest membership:
> http://lists.denveronline.net/mailman/options/jdom-interest/youraddr@yourhost.com



More information about the jdom-interest mailing list