|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectde.matthias_burbach.flux.StrutsConfigGenerator
Generates a struts-config-<module>.xml file from both a UML activity model and the previous version of the struts-config-<module>.xml file.
Is configurable by config/flux-config.xml and properties.
Nested Class Summary | |
protected class |
StrutsConfigGenerator.GeneratorMapping
Maps from a UML stereotype of a state to a generator plug-in that is registered to generate action mappings from UML states having this stereotype. |
Field Summary | |
protected org.jdom.Document |
fluxConfigDocument
The XML configuration of the generator specifiying the plug-ins. |
protected java.util.Properties |
settings
The global settings that configure and parameterize the generation process. |
Constructor Summary | |
StrutsConfigGenerator(java.util.Properties settings)
Convenience constructor, calls StrutsConfigGenerator(
Properties settings,
Document fluxConfigDocument)
passing null as second parameter. |
|
StrutsConfigGenerator(java.util.Properties settings,
org.jdom.Document fluxConfigDocument)
Attempts to load config/flux-config.xml if fluxConfigDocument is null . |
Method Summary | |
protected void |
backupFile(java.lang.String pathAndFile)
Backs up the file passed in if the settings property 'CreateBackup' is not 'false'. |
void |
generate()
Performs the generation process. |
protected void |
generateActionMappings(StateMachine stateMachine,
org.jdom.Document oldDocument,
org.jdom.Document newDocument)
Prepares and drives the actual generation that is performed by the plugged-in generators being registered for stereotyped states. |
protected void |
generateForStereotype(StateMachine stateMachine,
org.jdom.Document oldDocument,
org.jdom.Element oldActionMappingsElement,
org.jdom.Document newDocument,
org.jdom.Element newActionMappingsElement,
java.lang.String stereotype,
ActionMappingGenerator generator)
Executes the (begin, (generate)*, end) cycle for the generator passed in and all the states
having the specified stereotype . |
protected org.jdom.Element |
getActionMappingsElement(org.jdom.Document document)
Extracts the <action-mappings> element from the struts-config document passed in. |
protected java.lang.String |
getDefaultGeneratorComment()
|
protected ActionMappingGenerator |
getGenerator(java.lang.String type)
Instantiates the ActionMappingGenerator
specified by type using the default constructor. |
protected org.jdom.Comment |
getGeneratorComment()
If the settings property 'GeneratorComment' is specified its value is returned, else the default comment is returned. |
protected java.util.List |
getGeneratorMappings()
Constructs the Java representations of the generator mappings defined in the flux-config XML document. |
protected ModelBuilder |
getModelBuilder()
Instantiates the model builder plug-in as specified in the flux-config document. |
protected ModelChecker |
getModelChecker()
Instantiates the model checker plug-in as specified in the flux-config document. |
static java.lang.String |
getModelCheckerProblemReport(ModelCheckerException mce)
Constructs a single, long string from all the detail messages in the model checker exception. |
protected java.lang.String |
getPathAndFile(java.lang.String fileType)
Concatenates the two properties < fileType >Path and
<fileType >File to construct an absolute path. |
protected StateMachine |
loadStateMachine()
Constructs the input path and file from the settings properties 'InputPath' and 'InputFile', lets the model builder build and the model checker check the internal representation of the UML model. |
static void |
log(java.lang.String message)
Adds a timestamp to the message and logs it to the console. |
static void |
main(java.lang.String[] args)
Executes the generator in command line mode. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected java.util.Properties settings
protected org.jdom.Document fluxConfigDocument
Constructor Detail |
public StrutsConfigGenerator(java.util.Properties settings) throws java.lang.Exception
StrutsConfigGenerator(
Properties settings,
Document fluxConfigDocument)
passing null
as second parameter.
public StrutsConfigGenerator(java.util.Properties settings, org.jdom.Document fluxConfigDocument) throws java.lang.Exception
fluxConfigDocument
is null
.
settings
- the global settings that configure and parameterize
the generation processfluxConfigDocument
- the basic configuration of the generator,
may be null
java.lang.Exception
- if anything goes unexpectedly wrongMethod Detail |
public void generate() throws ModelCheckerException, java.lang.Exception
ModelCheckerException
- if the model checker detected model
constraint violations
java.lang.Exception
- if anything goes unexpectedly wrongprotected java.lang.String getPathAndFile(java.lang.String fileType)
fileType
>Path and
<fileType
>File to construct an absolute path.
fileType
- the common prefix of the two file properties to be
concatenated
protected void backupFile(java.lang.String pathAndFile) throws java.lang.Exception
pathAndFile
- the file to be backed up
java.lang.Exception
- if anything goes unexpectedly wrongprotected void generateActionMappings(StateMachine stateMachine, org.jdom.Document oldDocument, org.jdom.Document newDocument) throws java.lang.Exception
stateMachine
- the state machine to generate fromoldDocument
- the previous version of the generated struts-confignewDocument
- the new struts-config being generated
java.lang.Exception
- if anything goes unexpectedly wrongprotected java.util.List getGeneratorMappings() throws java.lang.Exception
StrutsConfigGenerator.GeneratorMapping
java.lang.Exception
- if anything goes unexpectedly wrongprotected ActionMappingGenerator getGenerator(java.lang.String type) throws java.lang.Exception
ActionMappingGenerator
specified by type
using the default constructor.
type
- the fully qualified name of the class to be instantiated
java.lang.Exception
- if anything goes unexpectedly wrongprotected org.jdom.Element getActionMappingsElement(org.jdom.Document document) throws java.lang.Exception
document
passed in.
document
- the struts-config document
java.lang.Exception
- if anything goes unexpectedly wrongprotected void generateForStereotype(StateMachine stateMachine, org.jdom.Document oldDocument, org.jdom.Element oldActionMappingsElement, org.jdom.Document newDocument, org.jdom.Element newActionMappingsElement, java.lang.String stereotype, ActionMappingGenerator generator) throws java.lang.Exception
generator
passed in and all the states
having the specified stereotype
.
stateMachine
- the state machine to be generated fromoldDocument
- the previous version of the struts-config documentoldActionMappingsElement
- the previous version of the elementnewDocument
- the new document under constructionnewActionMappingsElement
- the new element under constructionstereotype
- the stereotype of states to be consideredgenerator
- the generator plug-in to be called
java.lang.Exception
- if anything goes unexpectedly wrongprotected StateMachine loadStateMachine() throws ModelCheckerException, java.lang.Exception
ModelCheckerException
- if the model checker finds model constraint
violations
java.lang.Exception
- if anything goes unexpectedly wrongprotected ModelBuilder getModelBuilder() throws java.lang.Exception
java.lang.Exception
- if anything goes unexpectedly wrongprotected ModelChecker getModelChecker() throws java.lang.Exception
java.lang.Exception
- if anything goes unexpectedly wrongprotected org.jdom.Comment getGeneratorComment()
protected java.lang.String getDefaultGeneratorComment()
public static void main(java.lang.String[] args)
args
- the command line parameters as described abovepublic static void log(java.lang.String message)
message
and logs it to the console.
message
- the message to be loggedpublic static java.lang.String getModelCheckerProblemReport(ModelCheckerException mce)
mce
- the model checker exception to read the details from
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |