[jdom-interest] RFE: Attribute.setValue()

Oliver Imbusch flabes at livis.de
Sat Aug 19 00:20:28 PDT 2000

>>>>> "Jason" == Jason Hunter <jhunter at collab.net> writes:

    Jason> Oliver Imbusch wrote:

    >> it would be nice if Attribute.setValue() would return 'this',
    >> like a lot of other setter methods.

    Jason> I can see a symmetry argument for returning this, but
    Jason> what's the coding benefit you're thinking of?

It's not that breathtaking. In a one-attribute Element derivative I
have the following:

    private Attribute propertyAsAttribute = new Attribute (propertyName, null, Namespace.NO_NAMESPACE);
    public Attribute getAttribute (String name) {
        // return pre-constructed attribute with the actual property
        // vakue filled in
        return propertyAsAttribute.setValue (property.toString ());

- Oliver

More information about the jdom-interest mailing list