org.argouml.model.uml
Class EventTreeDefinition

java.lang.Object
  |
  +--org.argouml.model.uml.EventTreeDefinition

class EventTreeDefinition
extends java.lang.Object

Class containing the definitions of all events in NSUML. The file eventtree.xml is loaded by this class and converted to a hashmap containing the classes firing events as keys and hashmaps containing eventnames as keys and eventtypes as values as values.


Field Summary
private  java.util.Map _definition
           
private  Logger _log
           
private static java.lang.String FILE_NAME
           
 
Constructor Summary
EventTreeDefinition()
          Create an instance of EventTreeDefinition, reading org/argouml/eventtree.xml to obtain the initial configuration.
 
Method Summary
(package private)  void addSource(java.lang.Class cSource, java.util.Map mpNameMap)
          Add event types for a single source to this event tree.
(package private)  void addSourcesFromDocument(org.w3c.dom.Document doc)
          Add all event sources described by the given document.
private  java.lang.Class formatClass(java.lang.Class inputClass)
           
 EventKey[] getEventTypes(java.lang.Class modelClass)
          Returns all eventkeys that an instance of the given modelClass could possibly fire.
 EventKey[] getEventTypes(java.lang.Class modelClass, java.lang.String name)
          Returns all EventKeys (eventdefinitions) with the given eventName that the given modelClass can fire.
private  org.w3c.dom.Document loadDocument()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_log

private Logger _log

FILE_NAME

private static final java.lang.String FILE_NAME
See Also:
Constant Field Values

_definition

private java.util.Map _definition
Constructor Detail

EventTreeDefinition

public EventTreeDefinition()
Create an instance of EventTreeDefinition, reading org/argouml/eventtree.xml to obtain the initial configuration.

Method Detail

addSourcesFromDocument

void addSourcesFromDocument(org.w3c.dom.Document doc)

Add all event sources described by the given document. The document must match the pattern given by the following example:

 <eventtree>
   <source classname="classname of a model element">
     <eventtype name="event fired by this model element">
       <type>1</type>
     </eventtype>
   </source>
 </eventtree>
 
The classname is fully qualified.

The type is one of the numbers defined in MElementEvent. Each of the elements can be used multiple times.

Parameters:
doc - the document, the contents of which should be added to this event tree definition. This must be preparsed.

addSource

void addSource(java.lang.Class cSource,
               java.util.Map mpNameMap)
Add event types for a single source to this event tree.

Parameters:
cSource - the source class for which to add event types.
mpNameMap - a map of the event types to add for the source class. The keys are Strings indicating the names of events, while the values are int[] which contain all the event types the indicated event represents. The specific int values used can be found in MElementEvent.

getEventTypes

public EventKey[] getEventTypes(java.lang.Class modelClass)
Returns all eventkeys that an instance of the given modelClass could possibly fire.

Parameters:
modelClass -
Returns:

getEventTypes

public EventKey[] getEventTypes(java.lang.Class modelClass,
                                java.lang.String name)
Returns all EventKeys (eventdefinitions) with the given eventName that the given modelClass can fire.

Parameters:
modelClass -
name -
Returns:

loadDocument

private org.w3c.dom.Document loadDocument()

formatClass

private java.lang.Class formatClass(java.lang.Class inputClass)


ArgoUML © 1996-2004 (20040306)ArgoUML HomepageArgoUML Developers' pageArgoUML Cookbook