Class EventModel

  • All Implemented Interfaces:
    java.io.Serializable, org.apache.xmlgraphics.util.XMLizable

    public class EventModel
    extends java.lang.Object
    implements java.io.Serializable, org.apache.xmlgraphics.util.XMLizable
    Represents a whole event model that supports multiple event producers.
    See Also:
    Serialized Form
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.util.Map producers  
      private static long serialVersionUID  
    • Constructor Summary

      Constructors 
      Constructor Description
      EventModel()
      Creates a new, empty event model
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addProducer​(EventProducerModel producer)
      Adds the model of an event producer to the event model.
      EventProducerModel getProducer​(java.lang.Class clazz)
      Returns the model of an event producer with the given interface.
      EventProducerModel getProducer​(java.lang.String interfaceName)
      Returns the model of an event producer with the given interface name.
      java.util.Iterator getProducers()
      Returns an iterator over the contained event producer models.
      void saveToXML​(java.io.File modelFile)
      Saves this event model to an XML file.
      void toSAX​(org.xml.sax.ContentHandler handler)
      private void writeXMLizable​(org.apache.xmlgraphics.util.XMLizable object, java.io.File outputFile)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • producers

        private java.util.Map producers
    • Constructor Detail

      • EventModel

        public EventModel()
        Creates a new, empty event model
    • Method Detail

      • addProducer

        public void addProducer​(EventProducerModel producer)
        Adds the model of an event producer to the event model.
        Parameters:
        producer - the event producer model
      • getProducers

        public java.util.Iterator getProducers()
        Returns an iterator over the contained event producer models.
        Returns:
        an iterator (Iterator<EventProducerModel>)
      • getProducer

        public EventProducerModel getProducer​(java.lang.String interfaceName)
        Returns the model of an event producer with the given interface name.
        Parameters:
        interfaceName - the fully qualified name of the event producer
        Returns:
        the model instance for the event producer (or null if it wasn't found)
      • getProducer

        public EventProducerModel getProducer​(java.lang.Class clazz)
        Returns the model of an event producer with the given interface.
        Parameters:
        clazz - the interface of the event producer
        Returns:
        the model instance for the event producer (or null if it wasn't found)
      • toSAX

        public void toSAX​(org.xml.sax.ContentHandler handler)
                   throws org.xml.sax.SAXException
        Specified by:
        toSAX in interface org.apache.xmlgraphics.util.XMLizable
        Throws:
        org.xml.sax.SAXException
      • writeXMLizable

        private void writeXMLizable​(org.apache.xmlgraphics.util.XMLizable object,
                                    java.io.File outputFile)
                             throws java.io.IOException
        Throws:
        java.io.IOException
      • saveToXML

        public void saveToXML​(java.io.File modelFile)
                       throws java.io.IOException
        Saves this event model to an XML file.
        Parameters:
        modelFile - the target file
        Throws:
        java.io.IOException - if an I/O error occurs