Class DefaultEventType

  • All Implemented Interfaces:
    EventType, XmlSerializable

    public class DefaultEventType
    extends java.lang.Object
    implements EventType
    DefaultEventType defines a simple EventType implementation that only consists of a qualified event name consisting of namespace plus local name.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static EventType[] create​(java.lang.String[] localNames, Namespace namespace)
      Factory method to create an array of new EventType for the specified localNames and the specified namespace.
      static EventType create​(java.lang.String localName, Namespace namespace)
      Factory method to create a new EventType.
      static EventType[] createFromXml​(org.w3c.dom.Element eventType)
      Retrieves one or multiple EventTypes from the 'eventtype' Xml element.
      java.lang.String getName()  
      Namespace getNamespace()  
      org.w3c.dom.Element toXml​(org.w3c.dom.Document document)
      Returns a single empty Xml element where namespace and local name of this event type define the elements name.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • create

        public static EventType create​(java.lang.String localName,
                                       Namespace namespace)
        Factory method to create a new EventType.
        Parameters:
        localName -
        namespace -
        Returns:
      • create

        public static EventType[] create​(java.lang.String[] localNames,
                                         Namespace namespace)
        Factory method to create an array of new EventType for the specified localNames and the specified namespace.
        Parameters:
        localNames -
        namespace -
        Returns:
        An array of event types.
      • createFromXml

        public static EventType[] createFromXml​(org.w3c.dom.Element eventType)
        Retrieves one or multiple EventTypes from the 'eventtype' Xml element. While a subscription may register multiple types (thus the 'eventtype' contains multiple child elements), a single event may only refer to one single type.
        Parameters:
        eventType -
        Returns:
      • toXml

        public org.w3c.dom.Element toXml​(org.w3c.dom.Document document)
        Returns a single empty Xml element where namespace and local name of this event type define the elements name.
         EventType.create("someevent", Namespace.getNamespace("F", "http://www.foo.bar/eventtypes"));
        
         returns the following element upon call of toXml:
        
         <F:someevent xmlns:F="http://www.foo.bar/eventtypes" />
         
        Specified by:
        toXml in interface XmlSerializable
        Parameters:
        document - to be used as factory.
        Returns:
        a w3c element representing this object
        See Also:
        XmlSerializable.toXml(Document)