de.matthias_burbach.flux
Interface ActionMappingGenerator

All Known Implementing Classes:
AbstractActionMappingGenerator

public interface ActionMappingGenerator

Generates one or more contiguous pieces of XML (usually comments or above all <action> elements) that are valid in a struts-config-<module>.xml file between the opening and the closing <action-mappings> tag.

Is a plug-in interface. The implementations to be used must be configured in the flux-config.xml file. For each UML stereotype that may be attached to any of the UML states one or more implementations of this interface may be registered. They will be called in the order of occurrence as defined in the flux-config.xml file.

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)
          Is called only once after the call to setSettings(Properties) and before any call to any other method.
 void end(StateMachine stateMachine, org.jdom.Document oldDocument, org.jdom.Element oldActionMappingsElement, org.jdom.Document newDocument, org.jdom.Element newActionMappingsElement)
          Is called only once at the end of the generation cycle of this generator plug-in instance.
 void generate(StateMachine stateMachine, State state, org.jdom.Document oldDocument, org.jdom.Element oldActionMappingsElement, org.jdom.Document newDocument, org.jdom.Element newActionMappingsElement)
          Is called once for each UML state that has the stereotype specified in the flux-config.xml file for this generator.
 void setSettings(java.util.Properties settings)
          Is called at the beginning of the generation before any other method.
 

Method Detail

setSettings

public void setSettings(java.util.Properties settings)
Is called at the beginning of the generation before any other method.

Parameters:
settings - holds simple properties that can be used by the generator to control the generation

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
Is called only once after the call to setSettings(Properties) and before any call to any other method.

Is suitable for header type generations like introductory comments or similar artefacts.

Parameters:
stateMachine - the UML state machine to generate from
oldDocument - the previously generated version of the complete XML output
oldActionMappingsElement - the previously generated version of the <action-mappings> element
newDocument - the XML output being under construction
newActionMappingsElement - the <action-mappings> element being under construction and to add children to
Throws:
java.lang.Exception - if anything goes unexpectedly wrong, will cancel the generation process

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
Is called once for each UML state that has the stereotype specified in the flux-config.xml file for this generator.

Usually, does the bulk of the generation. Generates <action> elements that are normally derived from the state passed in and its (outbound) transitions.

Parameters:
stateMachine - the UML state machine to generate from
state - the current UML state to generate from
oldDocument - the previously generated version of the complete XML output
oldActionMappingsElement - the previously generated version of the <action-mappings> element
newDocument - the XML output being under construction
newActionMappingsElement - the <action-mappings> element being under construction and to add children to
Throws:
java.lang.Exception - if anything goes unexpectedly wrong, will cancel the generation process

end

public void end(StateMachine stateMachine,
                org.jdom.Document oldDocument,
                org.jdom.Element oldActionMappingsElement,
                org.jdom.Document newDocument,
                org.jdom.Element newActionMappingsElement)
         throws java.lang.Exception
Is called only once at the end of the generation cycle of this generator plug-in instance.

Is suitable for footer type generations like closing comments or similar artefacts.

Parameters:
stateMachine - the UML state machine to generate from
oldDocument - the previously generated version of the complete XML output
oldActionMappingsElement - the previously generated version of the <action-mappings> element
newDocument - the XML output being under construction
newActionMappingsElement - the <action-mappings> element being under construction and to add children to
Throws:
java.lang.Exception - if anything goes unexpectedly wrong, will cancel the generation process