de.matthias_burbach.flux
Class PagePreProcessActionMappingGenerator
java.lang.Object
de.matthias_burbach.flux.AbstractActionMappingGenerator
de.matthias_burbach.flux.PagePreProcessActionMappingGenerator
- All Implemented Interfaces:
- ActionMappingGenerator
- public class PagePreProcessActionMappingGenerator
- extends AbstractActionMappingGenerator
Generates one action mapping for each UML state with stereotype 'Page'
that maps to a transformer class which does preprocessing as a
preparatory step before actually forwarding to the physical page.
The generated mapping does step one of the two steps in so called
'double step display'.
- Author:
- Matthias Burbach
Method Summary |
void |
begin(StateMachine stateMachine,
org.jdom.Document oldDocument,
org.jdom.Element oldActionMappingsElement,
org.jdom.Document newDocument,
org.jdom.Element newActionMappingsElement)
Introduces the <action> elements generated by this generator
with the comment <--Page State Preprocessings-->. |
void |
generate(StateMachine stateMachine,
State state,
org.jdom.Document oldDocument,
org.jdom.Element oldActionMappingsElement,
org.jdom.Document newDocument,
org.jdom.Element newActionMappingsElement)
Generates one <action> element per call. |
protected boolean |
generatePagePreprocessings()
|
protected java.lang.String |
getDefaultType(State state)
|
protected java.lang.String |
getForwardPath(State targetState)
Constructs a forward path which mainly
depends on the target state's stereotype. |
Methods inherited from class de.matthias_burbach.flux.AbstractActionMappingGenerator |
end, generateForward, generateForward, generateForwards, generateProperty, getActionMappingElementForPath, getBasePath, getBasePathExtension, getDefaultName, getDefaultPackage, getForwardElementForName, getForwardPath, getForwardPathPrefix, getForwardPathSuffix, getNamePartOfBasePath, setSettings |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
PagePreProcessActionMappingGenerator
public PagePreProcessActionMappingGenerator()
begin
public void begin(StateMachine stateMachine,
org.jdom.Document oldDocument,
org.jdom.Element oldActionMappingsElement,
org.jdom.Document newDocument,
org.jdom.Element newActionMappingsElement)
throws java.lang.Exception
- Introduces the <action> elements generated by this generator
with the comment <--Page State Preprocessings-->.
- Specified by:
begin
in interface ActionMappingGenerator
- Overrides:
begin
in class AbstractActionMappingGenerator
- Throws:
java.lang.Exception
generate
public void generate(StateMachine stateMachine,
State state,
org.jdom.Document oldDocument,
org.jdom.Element oldActionMappingsElement,
org.jdom.Document newDocument,
org.jdom.Element newActionMappingsElement)
throws java.lang.Exception
- Generates one <action> element per call. The generated
path attribute follows the pattern '/Page.%NAME%.display'.
Preserves all attributes from the previous version of the element
except the disallowed attributes.
Generates one nested <forward> element with name
'hasSucceeded' and preserves all child elements except the disallowed
<forward> elements
(like <set-property>, e. g.) from the previous version.
- Specified by:
generate
in interface ActionMappingGenerator
- Overrides:
generate
in class AbstractActionMappingGenerator
- Throws:
java.lang.Exception
getForwardPath
protected java.lang.String getForwardPath(State targetState)
throws java.lang.Exception
- Constructs a forward path which mainly
depends on the target state's stereotype.
- Parameters:
targetState
- the target state the path is to be derived from
- Returns:
- the forward path
- Throws:
java.lang.Exception
- if anything goes unexpectedly wrong
generatePagePreprocessings
protected boolean generatePagePreprocessings()
getDefaultType
protected java.lang.String getDefaultType(State state)
- Overrides:
getDefaultType
in class AbstractActionMappingGenerator
- Parameters:
state
- the state the default Java type is to be derived from
- Returns:
- the default fully qualified Java class name derived from the
the default package and the state's name