fUML.Semantics.Loci.LociL1.ExecutionFactoryL1 Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of fuml Show documentation
Show all versions of fuml Show documentation
This open source software is a reference implementation, consisting of software and related files, for the OMG specification called the Semantics of a Foundational Subset for Executable UML Models (fUML). The reference implementation is intended to implement the execution semantics of UML activity models, accepting an XMI file from a conformant UML model as its input and providing an execution trace of the selected activity model(s) as its output. The core execution engine, which is directly generated from the normative syntactic and semantic models for fUML, may also be used as a library implementation of fUML in other software.
/*
* Initial version copyright 2008 Lockheed Martin Corporation, except
* as stated in the file entitled Licensing-Information.
*
* All modifications copyright 2009-2017 Data Access Technologies, Inc.
*
* Licensed under the Academic Free License version 3.0
* (http://www.opensource.org/licenses/afl-3.0.php), except as stated
* in the file entitled Licensing-Information.
*/
package fUML.Semantics.Loci.LociL1;
import fUML.Syntax.Classes.Kernel.*;
import fUML.Semantics.Classes.Kernel.*;
import fUML.Semantics.CommonBehaviors.Communications.CallEventBehavior;
import fUML.Semantics.CommonBehaviors.Communications.CallEventExecution;
public class ExecutionFactoryL1 extends
fUML.Semantics.Loci.LociL1.ExecutionFactory {
public fUML.Semantics.Loci.LociL1.SemanticVisitor instantiateVisitor(
fUML.Syntax.Classes.Kernel.Element element) {
// Instantiate a visitor object for the given element (at Conformance
// Level 1)
SemanticVisitor visitor = null;
if (element instanceof LiteralBoolean) {
visitor = new LiteralBooleanEvaluation();
}
else if (element instanceof LiteralString) {
visitor = new LiteralStringEvaluation();
}
else if (element instanceof LiteralNull) {
visitor = new LiteralNullEvaluation();
}
else if (element instanceof InstanceValue) {
visitor = new InstanceValueEvaluation();
}
else if (element instanceof LiteralUnlimitedNatural) {
visitor = new LiteralUnlimitedNaturalEvaluation();
}
else if (element instanceof LiteralInteger) {
visitor = new LiteralIntegerEvaluation();
}
else if (element instanceof LiteralReal) {
visitor = new LiteralRealEvaluation();
}
else if (element instanceof CallEventBehavior) {
visitor = new CallEventExecution();
}
return visitor;
} // instantiateVisitor
} // ExecutionFactoryL1