- All Known Implementing Classes:
public interface DocumentEvent
- See Also:
Nested Class Summary
Nested Classes Modifier and Type Interface Description
DocumentEvent.ElementChangeDescribes changes made to a specific element.
DocumentEvent.EventTypeEnumeration for document event types
Modifier and Type Method Description
getChange(Element elem)Gets the change information for the given element.
getDocument()Gets the document that sourced the change event.
getLength()Returns the length of the change.
getOffset()Returns the offset within the document of the start of the change.
getType()Gets the type of event.
getOffsetint getOffset()Returns the offset within the document of the start of the change.
- the offset >= 0
getLengthint getLength()Returns the length of the change.
- the length >= 0
getDocumentDocument getDocument()Gets the document that sourced the change event.
- the document
getTypeDocumentEvent.EventType getType()Gets the type of event.
- the type
getChangeDocumentEvent.ElementChange getChange(Element elem)Gets the change information for the given element. The change information describes what elements were added and removed and the location. If there were no changes, null is returned.
This method is for observers to discover the structural changes that were made. This means that only elements that existed prior to the mutation (and still exist after the mutation) need to have ElementChange records. The changes made available need not be recursive.
For example, if the an element is removed from it's parent, this method should report that the parent changed and provide an ElementChange implementation that describes the change to the parent. If the child element removed had children, these elements do not need to be reported as removed.
If an child element is insert into a parent element, the parent element should report a change. If the child element also had elements inserted into it (grandchildren to the parent) these elements need not report change.
elem- the element
- the change information, or null if the element was not modified