/** * Locks this element. A locked element cannot have any changes made to its * content or its attributes or child elements. This will also lock all * attributes and child elements as well. Once this method has been called, * this element can be safely published to other threads. */ public Element lock() { state.locked = true; if (state.attributes != null) { for (Attribute att : state.attributes.values()) { att.lock(); } } if (state.elements != null) { for (Object childObj : state.elements.values()) { if (childObj instanceof Element) { ((Element) childObj).lock(); } else { for (Element child : castElementCollection(childObj)) { child.lock(); } } } } return this; }
/** * Locks this element. A locked element cannot have any changes made to its * content or its attributes or child elements. This will also lock all * attributes and child elements as well. Once this method has been called, * this element can be safely published to other threads. */ public Element lock() { state.locked = true; if (state.attributes != null) { for (Attribute att : state.attributes.values()) { att.lock(); } } if (state.elements != null) { for (Object childObj : state.elements.values()) { if (childObj instanceof Element) { ((Element) childObj).lock(); } else { for (Element child : castElementCollection(childObj)) { child.lock(); } } } } return this; }
/** * Locks this element. A locked element cannot have any changes made to its * content or its attributes or child elements. This will also lock all * attributes and child elements as well. Once this method has been called, * this element can be safely published to other threads. */ public Element lock() { state.locked = true; if (state.attributes != null) { for (Attribute att : state.attributes.values()) { att.lock(); } } if (state.elements != null) { for (Object childObj : state.elements.values()) { if (childObj instanceof Element) { ((Element) childObj).lock(); } else { for (Element child : castElementCollection(childObj)) { child.lock(); } } } } return this; }