Logo Search packages:      
Sourcecode: jclic version File versions  Download package

Element org::jdom::Element::setAttributes ( List  newAttributes  )  [inline]

This sets the attributes of the element. The supplied List should contain only objects of type Attribute.

When all objects in the supplied List are legal and before the new attributes are added, all old attributes will have their parentage set to null (no parent) and the old attribute list will be cleared. This has the effect that any active attribute list (previously obtained with a call to getAttributes) will also change to reflect the new attributes. In addition, all attributes in the supplied List will have their parentage set to this element, but the List itself will not be "live" and further removals and additions will have no effect on this elements attributes. If the user wants to continue working with a "live" attribute list, then a call to setAttributes should be followed by a call to getAttributes to obtain a "live" version of the attributes.

Passing a null or empty List clears the existing attributes.

In cases where the List contains duplicate attributes, only the last one will be retained. This has the same effect as calling setAttribute(Attribute) sequentially.

In event of an exception the original attributes will be unchanged and the attributes in the supplied attributes will be unaltered.

newAttributes List of attributes to set
this element modified
IllegalAddException if the List contains objects that are not instances of Attribute, or if any of the Attribute objects have conflicting namespace prefixes.

Definition at line 1096 of file Element.java.

References attributes, and org::jdom::AttributeList::clearAndSet().

        return this;

Generated by  Doxygen 1.6.0   Back to index