|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectde.matthias_burbach.flux.ChameleonModelBuilder
Builds the internal UML model representation from an XML file that was exported with the Rational Rose add in 'Chameleon'.
Has been developed for and tested with input files that were created with Rational Rose v2002 and exported with the Chameleon add-in, which is part of the Flux distribution since Flux version 1.1.0. Chameleon supersedes the Unisys XMI export add in as the preferred way of exporting Rational Rose models because the XMI add in does not export the documentation property of transitions in state/activity diagrams. As a solution was required to support multi instance modelling in Rose Chameleon was created and became part of Flux.
Constructor Summary | |
ChameleonModelBuilder()
|
Method Summary | |
protected void |
addActionsToState(org.jdom.Element stateElement,
State state)
Adds actions to the state that result from the following
XPath select (relative to the state element):'DoAction' |
protected void |
assignTransitionsToStates(org.jdom.Element modelElement,
java.util.HashMap states)
Creates UML transitions from the XPath select 'descendant::Transition' (relative to modelElement )
and assigns them to the states they are linked to.
|
protected void |
assignVariablesToStates(java.util.HashMap states,
java.util.Vector variables)
|
Model |
build(java.lang.String sourceUrl)
Loads the Chameleon XML document from the sourceUrl and
builds the model from it. |
protected Model |
buildModelFromXmlDocument(org.jdom.Document xmlDocument)
Builds the model from the Chameleon XML document. |
protected java.util.Vector |
createAttributesForClass(org.jdom.Element classElement)
Creates UML attributes from the XPath select 'descendant::Attribute' (relative to classElement ) |
protected java.util.List |
createClasses(org.jdom.Element modelElement)
Creates UML classes from the XPath select 'descendant::Class' (relative to modelElement ) |
protected java.util.HashMap |
createStates(org.jdom.Element modelElement)
Creates UML states from the following XPath selects (relative to modelElement ):
'descendant::State'
'descendant::Activity'
|
protected java.util.HashMap |
createStatesForPath(org.jdom.Element modelElement,
java.lang.String xPathExpression)
Creates states from the state elements that can be selected with the xPathExpression (relative to modelElement ); |
protected java.util.Vector |
createVariables(org.jdom.Element modelElement)
Creates variables from all classes with stereotype 'Variable'. |
protected Variable |
findVariableByName(java.util.Vector variables,
java.lang.String variableName)
|
protected java.util.List |
getSortedStates(java.util.Collection states)
Sorts the states passed in by name (the order of states will affect the order of generated <action> elements). |
protected void |
sortTransitions(State state)
Sorts the outbound transitions of state by label,
i. e. event name or guard condition if the event name is not defined. |
protected void |
sortTransitionsForEachState(java.util.Collection states)
Sorts the transitions for each state by label, i. e. event name or guard condition if the event name is not defined (the order of transitions will affect the order of several generated <action> and <forward> elements). |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public ChameleonModelBuilder()
Method Detail |
public Model build(java.lang.String sourceUrl) throws java.lang.Exception
sourceUrl
and
builds the model from it.
build
in interface ModelBuilder
sourceUrl
- the location of the file to build from
java.lang.Exception
- if anything goes wrong unexpectedly.protected Model buildModelFromXmlDocument(org.jdom.Document xmlDocument) throws java.lang.Exception
xmlDocument
- the Chameleon XML document that contains exactly
one activity diagram modelling the web application
module plus optional classes that model mode variables
java.lang.Exception
- if anything goes unexpectedly wrongprotected void assignVariablesToStates(java.util.HashMap states, java.util.Vector variables)
states
- the states variables are to be assigned tovariables
- the variables to be assigned to 0, 1 or more statesprotected Variable findVariableByName(java.util.Vector variables, java.lang.String variableName)
variables
- the set of variables to search invariableName
- the name of the variable to be found
null
protected java.util.Vector createVariables(org.jdom.Element modelElement) throws java.lang.Exception
modelElement
- the model element to select from
Variable
java.lang.Exception
- if anything goes unexpectedly wrongprotected java.util.List getSortedStates(java.util.Collection states)
states
- the states built from the model file that are to be sorted
protected void sortTransitionsForEachState(java.util.Collection states)
states
- the states whose outbound transitions are to be sortedprotected void sortTransitions(State state)
state
by label,
i. e. event name or guard condition if the event name is not defined.
state
- the state whose outbound transitions are to be sortedprotected void assignTransitionsToStates(org.jdom.Element modelElement, java.util.HashMap states) throws java.lang.Exception
modelElement
)
and assigns them to the states they are linked to.
Creates all events and attaches them to the transitions.
Sets the transition's action if specified (not to be confounded with
an action activity!).
modelElement
- the model element to select fromstates
- the states transitions are to be assigned to
java.lang.Exception
protected java.util.HashMap createStates(org.jdom.Element modelElement) throws java.lang.Exception
modelElement
):
modelElement
- the model element to select from
State
hashed by their state element counterpart's id
java.lang.Exception
- if anything goes unexpectedly wrongprotected java.util.HashMap createStatesForPath(org.jdom.Element modelElement, java.lang.String xPathExpression) throws java.lang.Exception
xPathExpression
(relative to modelElement
);
modelElement
- the model element to select fromxPathExpression
- the select path
State
hashed by their state element counterpart's id
java.lang.Exception
- if anything goes unexpectedly wrongprotected void addActionsToState(org.jdom.Element stateElement, State state) throws java.lang.Exception
state
that result from the following
XPath select (relative to the state element):'DoAction'
stateElement
- the state element to select fromstate
- the state to add the actions to
java.lang.Exception
- if anything goes unexpectedly wrongprotected java.util.List createClasses(org.jdom.Element modelElement) throws java.lang.Exception
modelElement
)
modelElement
- the model element to select from
Class
hashed by their class element counterpart's xmi.id
java.lang.Exception
- if anything goes unexpectedly wrongprotected java.util.Vector createAttributesForClass(org.jdom.Element classElement) throws java.lang.Exception
classElement
)
classElement
- the class element to select from
String
java.lang.Exception
- if anything goes unexpectedly wrong
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |