/** * Clears internal state of all attributes, child elements, and text content. */ public void clear() { throwExceptionIfLocked(); state.value = null; state.attributes = null; state.elements = null; }
/** * Clears internal state of all attributes, child elements, and text content. */ public void clear() { throwExceptionIfLocked(); state.value = null; state.attributes = null; state.elements = null; }
/** * Clears internal state of all attributes, child elements, and text content. */ public void clear() { throwExceptionIfLocked(); state.value = null; state.attributes = null; state.elements = null; }
/** * Remove child element(s) of a given name. All elements with the given id * will be removed. * * @param id the id of the child element(s) to remove. * @return this element for chaining. */ public Element removeElement(QName id) { throwExceptionIfLocked(); if (state.elements != null) { state.elements.remove(id); } return this; }
/** * Remove child element(s) of a given name. All elements with the given id * will be removed. * * @param id the id of the child element(s) to remove. * @return this element for chaining. */ public Element removeElement(QName id) { throwExceptionIfLocked(); if (state.elements != null) { state.elements.remove(id); } return this; }
/** * Remove child element(s) of a given name. All elements with the given id * will be removed. * * @param id the id of the child element(s) to remove. * @return this element for chaining. */ public Element removeElement(QName id) { throwExceptionIfLocked(); if (state.elements != null) { state.elements.remove(id); } return this; }
/** * Puts an attribute into the attribute map, creating the map if needed. */ private void setAttribute(AttributeKey<?> attKey, Attribute attribute) { throwExceptionIfLocked(); if (state.attributes == null) { state.attributes = new LinkedHashMap<QName, Attribute>(); } state.attributes.put(attKey.getId(), attribute); }
/** * Puts an attribute into the attribute map, creating the map if needed. */ private void setAttribute(AttributeKey<?> attKey, Attribute attribute) { throwExceptionIfLocked(); if (state.attributes == null) { state.attributes = new LinkedHashMap<QName, Attribute>(); } state.attributes.put(attKey.getId(), attribute); }
/** * Remove attribute (if present). * * @param id the qualified name of the attribute. * @return this element */ public Object removeAttributeValue(QName id) { throwExceptionIfLocked(); Attribute removed = (state.attributes == null) ? null : state.attributes.remove(id); return (removed == null) ? null : removed.getValue(); }
/** * Remove attribute (if present). * * @param id the qualified name of the attribute. * @return this element */ public Object removeAttributeValue(QName id) { throwExceptionIfLocked(); Attribute removed = (state.attributes == null) ? null : state.attributes.remove(id); return (removed == null) ? null : removed.getValue(); }
/** * Sets the value of the element and returns the element to allow chaining. * * @param newValue element's value * @return this element * @throws IllegalStateException if the element is immutable * @throws IllegalArgumentException if the object is of an invalid type or * if this element does not allow a value */ public Element setTextValue(Object newValue) { throwExceptionIfLocked(); state.value = checkValue(key, newValue); return this; }
/** * Sets the value of the element and returns the element to allow chaining. * * @param newValue element's value * @return this element * @throws IllegalStateException if the element is immutable * @throws IllegalArgumentException if the object is of an invalid type or * if this element does not allow a value */ public Element setTextValue(Object newValue) { throwExceptionIfLocked(); state.value = checkValue(key, newValue); return this; }
/** * Remove attribute (if present). * * @param id the qualified name of the attribute. * @return this element */ public Object removeAttributeValue(QName id) { throwExceptionIfLocked(); Attribute removed = (state.attributes == null) ? null : state.attributes.remove(id); return (removed == null) ? null : removed.getValue(); }
/** * Puts an attribute into the attribute map, creating the map if needed. */ private void setAttribute(AttributeKey<?> attKey, Attribute attribute) { throwExceptionIfLocked(); if (state.attributes == null) { state.attributes = new LinkedHashMap<QName, Attribute>(); } state.attributes.put(attKey.getId(), attribute); }
/** * Sets the value of the element and returns the element to allow chaining. * * @param newValue element's value * @return this element * @throws IllegalStateException if the element is immutable * @throws IllegalArgumentException if the object is of an invalid type or * if this element does not allow a value */ public Element setTextValue(Object newValue) { throwExceptionIfLocked(); state.value = checkValue(key, newValue); return this; }
throwExceptionIfLocked(); boolean removed = false; if (state.elements != null) {
throwExceptionIfLocked(); boolean removed = false; if (state.elements != null) {
throwExceptionIfLocked(); if (state.elements == null) { state.elements = new LinkedHashMap<QName, Object>();
throwExceptionIfLocked(); if (state.elements == null) { state.elements = new LinkedHashMap<QName, Object>();