org.argouml.model.uml
Class EventTreeDefinition

java.lang.Object
  extended byorg.argouml.model.uml.EventTreeDefinition

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

Field Detail

LOG

private static final Logger LOG

FILE_NAME

private static final String FILE_NAME
See Also:
Constant Field Values

definition

private 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(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(Class cSource,
               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(Class modelClass)
Returns all eventkeys that an instance of the given modelClass could possibly fire.

Parameters:
modelClass -
Returns:
The event keys.

getEventTypes

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

Parameters:
modelClass -
name -
Returns:
All event keys.

loadDocument

private Document loadDocument()

formatClass

private Class formatClass(Class inputClass)


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