com.openharbor.xmlj.observer
Class ObservableElement
java.lang.Object
com.openharbor.xmlj.Element
com.openharbor.xmlj.observer.ObservableElement
- public class ObservableElement
- extends Element
An element whose changes can be observed by another object.
The observer might be a 'wrapper' proxy that provides a more meaningful
view of Element information.
For example, such a proxy could implement the java.util.Map interface
as a proxy for an Element, with Map.Entry objects that are proxies
for its subElements. The Map would need to observe changes to the
list of subElements, in order to maintain its index (e.g. hash table)
and enforce the Map invariant that no two entries have the same key.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ObservableElement
public ObservableElement()
getObserver
public ObservableElement.Observer getObserver()
setObserver
public void setObserver(ObservableElement.Observer observer)
setValue
public void setValue(java.lang.String value)
- Description copied from class:
Element
- Set the text contained in this element.
setValue(null) sets the text to EMPTY_VALUE.
This prevents the creation of Java structures that can't be represented in XML.
- Overrides:
setValue
in class Element
newAttributeMap
protected Element.AttributeMap newAttributeMap(java.util.Map real)
- Description copied from class:
Element
- Override this to customize the implementation of the attributes' Map.
- Overrides:
newAttributeMap
in class Element
newElementList
protected Element.ElementList newElementList()
- Description copied from class:
Element
- Override this to customize the implementation of the subElements' List.
- Overrides:
newElementList
in class Element