Class FWSimComponentGroupCodeGen
java.lang.Object
net.simplace.sim.model.FWSimComponentGroupCodeGen
Code generator for component groups: creates the Java class of a
FWSimComponentGroup and its group
configuration file (.grp.xml) from an AMEI-style model composition (description plus input, internal and
output links). The files are written into the source folder of simplace_modules, using the templates
codegen/FWSimComponentGroup.javatemplate and .xmltemplate from the class path.- Author:
- Andreas Enders
-
Constructor Summary
ConstructorsConstructorDescriptionCreates the generator: determines the source folder ofsimplace_modulesrelative to the template location and loads the templates. -
Method Summary
Modifier and TypeMethodDescriptiongenerateCodeAmeiXML(org.jdom2.Element aConfigElement, org.jdom2.Element aComposition, String aSourcePath, HashMap<String, String> aClassNameMap) Generates and writes the Java class and the group configuration file of a component group.writeCodeToFile(String aContentOfFile) Writes the generated Java code to the Java file.
-
Constructor Details
-
FWSimComponentGroupCodeGen
-
-
Method Details
-
generateCodeAmeiXML
public String generateCodeAmeiXML(org.jdom2.Element aConfigElement, org.jdom2.Element aComposition, String aSourcePath, HashMap<String, String> aClassNameMap) Generates and writes the Java class and the group configuration file of a component group.- Parameters:
aConfigElement- model unit element with attributesname(class name),id(package) and aDescriptionchild (Authors, Institution, Reference, Abstract)aComposition- element with theInputLink,InternalLinkandOutputLinkchildrenaSourcePath- not usedaClassNameMap- map from member id to member class name- Returns:
- the content of the generated Java class
-
writeCodeToFile
-