Package com.topologi.diffx.event.impl
Class OpenElementEventImpl
java.lang.Object
com.topologi.diffx.event.impl.DiffXEventBase
com.topologi.diffx.event.impl.OpenElementEventImpl
- All Implemented Interfaces:
DiffXEvent,OpenElementEvent,XMLFormattable,XMLWritable
A basic implementation of the close element event.
It corresponds to the startElement SAX event.
This implementation is not namespace aware.
- Version:
- 27 March 2010
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final intHashcode value for this event.private final StringThe local name of the element.Fields inherited from class com.topologi.diffx.event.impl.DiffXEventBase
ESC, weight -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanequals(DiffXEvent e) Returnstrueif the event is an open element event.getName()Returns the local name of the element.getURI()Returns the namespace URI the element belongs to.inthashCode()private static inttoHashCode(String s) Calculates the hashcode for this event.toString()voidWrites the XML representation of the implementing instance using the specifiedXMLWriter.toXML(StringBuffer xml) Converts this event to an XML open tag.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
-
name
The local name of the element. -
hashCode
private final int hashCodeHashcode value for this event.
-
-
Constructor Details
-
OpenElementEventImpl
Creates a new open element event.- Parameters:
name- The local name of the element- Throws:
NullPointerException- if the name isnull.
-
-
Method Details
-
getName
Description copied from interface:OpenElementEventReturns the local name of the element.- Specified by:
getNamein interfaceOpenElementEvent- Returns:
- Returns the name.
-
getURI
Description copied from interface:OpenElementEventReturns the namespace URI the element belongs to.- Specified by:
getURIin interfaceOpenElementEvent- Returns:
- Returns the Namespace URI.
-
hashCode
public int hashCode()Description copied from class:DiffXEventBase- Specified by:
hashCodein classDiffXEventBase
-
equals
Returnstrueif the event is an open 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
Converts this event to an XML open tag.Note that this method does not allow attributes to be put after this element. Appends 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.
-
toHashCode
Calculates the hashcode for this event.- Parameters:
s- String from which the hashcode is calculated.- Returns:
- a number suitable as a hashcode.
-