net.sf.vex.dom
Class DocumentEvent

java.lang.Object
  |
  +--java.util.EventObject
        |
        +--net.sf.vex.dom.DocumentEvent
All Implemented Interfaces:
java.io.Serializable

public class DocumentEvent
extends java.util.EventObject

Encapsulation of the details of a document change

See Also:
Serialized Form

Field Summary
 
Fields inherited from class java.util.EventObject
source
 
Constructor Summary
DocumentEvent(Document document, Element parentElement, int offset, int length)
          Class constructor.
DocumentEvent(Document document, Element parentElement, java.lang.String attributeName, java.lang.String oldAttributeValue, java.lang.String newAttributeValue)
          Class constructor used when firing an attributeChanged event.
 
Method Summary
 java.lang.String getAttributeName()
           
 Document getDocument()
           
 int getLength()
          Returns the length of the change.
 java.lang.String getNewAttributeValue()
           
 int getOffset()
          Returns the offset at which the change occurred.
 java.lang.String getOldAttributeValue()
           
 Element getParentElement()
          Returns the element containing the change.
 
Methods inherited from class java.util.EventObject
getSource, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DocumentEvent

public DocumentEvent(Document document,
                     Element parentElement,
                     int offset,
                     int length)
Class constructor.

Parameters:
document - Document that changed.
parentElement - Element containing the change.
offset - offset at which the change occurred.
length - length of the change.

DocumentEvent

public DocumentEvent(Document document,
                     Element parentElement,
                     java.lang.String attributeName,
                     java.lang.String oldAttributeValue,
                     java.lang.String newAttributeValue)
Class constructor used when firing an attributeChanged event.

Parameters:
document - Document that changed.
parentElement - element containing the attribute that changed
attributeName - name of the attribute that changed
oldAttributeValue - value of the attribute before the change.
newAttributeValue - value of the attribute after the change.
Method Detail

getLength

public int getLength()
Returns the length of the change.


getOffset

public int getOffset()
Returns the offset at which the change occurred.


getParentElement

public Element getParentElement()
Returns the element containing the change.


getNewAttributeValue

public java.lang.String getNewAttributeValue()
Returns:
the value of the attribute before the change. If null, indicates that the attribute was removed.

getOldAttributeValue

public java.lang.String getOldAttributeValue()
Returns:
the value of the attribute after the change. If null, indicates the attribute did not exist before the change.

getAttributeName

public java.lang.String getAttributeName()
Returns:
the name of the attribute that was changed.

getDocument

public Document getDocument()
Returns:
the document for which this event was generated