throw new IllegalArgumentException(MessageFormat.format(
"Element {0} does not have output {1} in {2}", cp.getElementName(),
cp.getConnectionName(), cp.getLocationText()));
return new SourceStore(src, param.i);
}
throw new UnknownConnectionException("Element "+cp.getElementName()+" in "+name.getText()
+" not known in "
+val.filename+" line "+val.line);
}
if(val instanceof NamelessSource){
// a data source that has a stream whose name need not be given. NamelessSources by contract always
// are NamedSources that connect to OUT
// NamedSource src=subs.get(val);
// return new SourceStore(src, StandardParameters.OUT.i);
}
if(val instanceof Element){
// a single name appearing in a formula must refer to an interface input or a process variable
String elementName=val.getText();
Parameter param=inputsByName().get(elementName);
if(param!=null){
return getInputProxy(elementName);
}
Variable v=containedVariables.get(elementName);
if(v != null){
return new SourceStore(v, StandardParameters.OUT.i);
}
throw new UnknownConnectionException("Input "+elementName+" in "+name.getText()
+" not known in "
+val.filename+" line "+val.line);
}
if(val instanceof Connection){
// TODO how to handle?
Connection c=(Connection)val;
@SuppressWarnings("unused")
ConnectionPoint cp=c.source;
throw new UnknownConnectionException("Connection "+c.getEndpoint()+" in "+name.getText()
+" not known in "
+val.filename+" line "+val.line);
}
if(val instanceof NamelessSource && val instanceof TemplateProvider){
return new SourceStore(((TemplateProvider)val).getTemplate().clone(), StandardParameters.OUT.i);
}
if(val instanceof ConnectionPoint){
// can this legally happen?
ConnectionPoint cp=(ConnectionPoint)val;
throw new UnknownConnectionException("ConnectionPoint "+
cp.getElementName()+"."+cp.getConnectionName()+" in "+name.getText()
+" of unknown type in "
+val.filename+" line "+val.line);
}
throw new UnknownConnectionException("Element "+val.getText()+" in "+name.getText()
+" of unknown type in "
+val.filename+" line "+val.line);
}