Class OpenElementEventNSImpl

java.lang.Object
com.topologi.diffx.event.impl.DiffXEventBase
com.topologi.diffx.event.impl.OpenElementEventNSImpl
All Implemented Interfaces:
DiffXEvent, OpenElementEvent, XMLFormattable, XMLWritable

public final class OpenElementEventNSImpl extends DiffXEventBase implements DiffXEvent, OpenElementEvent
The event corresponding to the startElement SAX event.
Version:
27 March 2010
  • Field Details

    • uri

      private final String uri
      The namespace URI of the element.
    • name

      private final String name
      The local name of the element.
    • hashCode

      private final int hashCode
      Hashcode value for this event.
  • Constructor Details

  • Method Details

    • getName

      public String getName()
      Description copied from interface: OpenElementEvent
      Returns the local name of the element.
      Specified by:
      getName in interface OpenElementEvent
      Returns:
      Returns the name.
    • getURI

      public String getURI()
      Description copied from interface: OpenElementEvent
      Returns the namespace URI the element belongs to.
      Specified by:
      getURI in interface OpenElementEvent
      Returns:
      Returns the namespace URI.
    • hashCode

      public int hashCode()
      Description copied from class: DiffXEventBase
      Specified by:
      hashCode in class DiffXEventBase
    • equals

      public boolean equals(DiffXEvent e)
      Returns true if the event is a open element event.
      Specified by:
      equals in interface DiffXEvent
      Specified by:
      equals in class DiffXEventBase
      Parameters:
      e - The event to compare with this event.
      Returns:
      true if this event is equal to the specified event; false otherwise.
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • toXML

      public void toXML(XMLWriter xml) throws IOException
      Description copied from interface: XMLWritable
      Writes the XML representation of the implementing instance using the specified XMLWriter.
      Specified by:
      toXML in interface XMLWritable
      Parameters:
      xml - The XMLWriter to use.
      Throws:
      IOException - IF an I/O exception occurs whilst writing.
    • toXML

      public StringBuffer toXML(StringBuffer xml)
      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:
      toXML in interface XMLFormattable
      Parameters:
      xml - The string buffer to which the XML representation is appended to.
      Returns:
      The modified string buffer.
    • toHashCode

      private int toHashCode(String uri, String name)
      Calculates the hashcode for this event.
      Parameters:
      uri - The namespace URI.
      name - The element name.
      Returns:
      a number suitable as a hashcode.