/*******************************************************************************\r
- * Copyright (c) 2010 Association for Decentralized Information Management in\r
+ * Copyright (c) 2007, 2011 Association for Decentralized Information Management in\r
* Industry THTH ry.\r
* All rights reserved. This program and the accompanying materials\r
* are made available under the terms of the Eclipse Public License v1.0\r
inputs.add((Input)element);\r
} else if (element instanceof Enumeration) {\r
enumerations.add((Enumeration)element);\r
- } else if (element instanceof Dependency && ((Dependency)element).refersTo() != null) {\r
+ } else if (element instanceof Dependency) {\r
Dependency dependency = (Dependency)element;\r
if(dependency.getHead() instanceof Module) {\r
outputDependencies.add(dependency);\r
Input variable = (Input)dependency.getHead();\r
Module module = (Module)dependency.getTail();\r
Variable reference = (Variable)dependency.refersTo();\r
- b.append(" " + variable.getName() + " = " + module.getName() + "." + reference.getName() + ";\n");\r
+ if(reference != null)\r
+ b.append(" " + variable.getName() + " = " + module.getName() + "." + reference.getName() + ";\n");\r
+ else\r
+ b.append(" " + variable.getName() + " = " + variable.getDefaultInputValue() + ";\n");\r
}\r
\r
b.append("// Outputs\n");\r
Variable variable = (Variable)dependency.getTail();\r
Module module = (Module)dependency.getHead();\r
Input reference = (Input)dependency.refersTo();\r
- b.append(" " + module.getName() + "." + reference.getName() + " = " + variable.getName() + ";\n");\r
- moduleInputs.get(module.getName()).remove(reference);\r
+ if(reference != null) {\r
+ b.append(" " + module.getName() + "." + reference.getName() + " = " + variable.getName() + ";\n");\r
+ moduleInputs.get(module.getName()).remove(reference);\r
+ }\r
}\r
\r
b.append("// Default values for inputs in modules\n");\r