Outlet outlet = controllerState.getUnitConfiguration()
.getOutletConfiguration()
.getOutlet(qualifiedOutletName);
if (outlet == null)
{
throw new GeneratorException("ApplyAction : The outlet "
+ outletName
+ " does not exist");
}
SourceElement currentElement = controllerState.getSourceElement();
String detokenizedPath = tokenReplacer.process(path);
List<SourceElement> selectedElements
= SourcePath.getElements(currentElement, detokenizedPath);
if (selectedElements.isEmpty())
{
if (!acceptNotSet)
{
throw new GeneratorException(
"ApplyAction : selected path "
+ path
+ " does not match an element"
+ " and acceptNotSet was set to false");
}
return new OutletResult("");
}
if (selectedElements.size() > 1)
{
throw new GeneratorException(
"ApplyAction : selected path "
+ path
+ " contains more than one element ("
+ selectedElements.size()
+ " times)");