Package com.topologi.diffx.event.impl
Class CloseElementEventNSImpl
java.lang.Object
com.topologi.diffx.event.impl.DiffXEventBase
com.topologi.diffx.event.impl.CloseElementEventNSImpl
- All Implemented Interfaces:
CloseElementEvent,DiffXEvent,XMLFormattable,XMLWritable
The event corresponding to the
startElement SAX event.- Version:
- 28 March 2010
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final OpenElementEventThe corresponding open element event.Fields inherited from class com.topologi.diffx.event.impl.DiffXEventBase
ESC, weight -
Constructor Summary
ConstructorsConstructorDescriptionCreates a new close element event from the corresponding open element event.Creates a new close element event on the default namespace URI.CloseElementEventNSImpl(String uri, String name) Creates a new close element event. -
Method Summary
Modifier and TypeMethodDescriptionbooleanequals(DiffXEvent e) Returnstrueif the event is a close element event.getName()Returns the local name of the element.Returns the corresponding event element.getURI()Returns the namespace URI the element belongs to.inthashCode()booleanmatch(OpenElementEvent event) Indicates whether the specified open element event matches this close element event.toString()voidWrites the XML representation of the implementing instance using the specifiedXMLWriter.toXML(StringBuffer xml) Appends the XML representation of the object of the implementing class.Methods inherited from class com.topologi.diffx.event.impl.DiffXEventBase
equals, getWeight, setWeight, toXMLMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface com.topologi.diffx.event.DiffXEvent
getWeight, setWeightMethods inherited from interface com.topologi.diffx.xml.XMLFormattable
toXML
-
Field Details
-
open
The corresponding open element event.
-
-
Constructor Details
-
CloseElementEventNSImpl
Creates a new close element event on the default namespace URI.- Parameters:
name- The local name of the element- Throws:
NullPointerException- If the name isnull.
-
CloseElementEventNSImpl
Creates a new close element event.- Parameters:
uri- The namespace URI of the elementname- The local name of the element- Throws:
NullPointerException- if any of the argument isnull.
-
CloseElementEventNSImpl
Creates a new close element event from the corresponding open element event.- Parameters:
event- The corresponding open element event.- Throws:
NullPointerException- If the name isnull.
-
-
Method Details
-
getName
Description copied from interface:CloseElementEventReturns the local name of the element.- Specified by:
getNamein interfaceCloseElementEvent- Returns:
- Returns the name.
-
getURI
Description copied from interface:CloseElementEventReturns the namespace URI the element belongs to.This method should return
nullif the implementation is not namespace aware.- Specified by:
getURIin interfaceCloseElementEvent- Returns:
- Returns the namespace URI.
-
getOpenElement
Description copied from interface:CloseElementEventReturns the corresponding event element.- Specified by:
getOpenElementin interfaceCloseElementEvent- Returns:
- The corresponding event element.
-
match
Description copied from interface:CloseElementEventIndicates whether the specified open element event matches this close element event.This method first checks whether the open element event is the same as event returned by the
CloseElementEvent.getOpenElement()method, if not it simply compares the name of the element and the namespace URI it belongs to.- Specified by:
matchin interfaceCloseElementEvent- Parameters:
event- The open element event to test.- Returns:
trueif there is a match;falseotherwise.
-
hashCode
public int hashCode()Description copied from class:DiffXEventBase- Specified by:
hashCodein classDiffXEventBase
-
equals
Returnstrueif the event is a close element event.- Specified by:
equalsin interfaceDiffXEvent- Specified by:
equalsin classDiffXEventBase- Parameters:
e- The event to compare with this event.- Returns:
trueif this event is equal to the specified event;falseotherwise.
-
toString
-
toXML
Description copied from interface:XMLWritableWrites the XML representation of the implementing instance using the specifiedXMLWriter.- Specified by:
toXMLin interfaceXMLWritable- Parameters:
xml- The XMLWriter to use.- Throws:
IOException- IF an I/O exception occurs whilst writing.
-
toXML
Description copied from interface:XMLFormattableAppends the XML representation of the object of the implementing class.Implementations must ensure that the returned string buffer is the same object as the specified string buffer.
- Specified by:
toXMLin interfaceXMLFormattable- Parameters:
xml- The string buffer to which the XML representation is appended to.- Returns:
- The modified string buffer.
- Throws:
NullPointerException- if the specified character sequence isnull.
-