use of org.osate.aadl2.contrib.aadlproject.SupportedConnectionPatterns in project osate2 by osate.
the class CommunicationProperties method getConnectionPattern.
public static Optional<List<List<SupportedConnectionPatterns>>> getConnectionPattern(NamedElement lookupContext, Optional<Mode> mode) {
Property property = getConnectionPattern_Property(lookupContext);
try {
PropertyExpression value = CodeGenUtil.lookupProperty(property, lookupContext, mode);
PropertyExpression resolved = CodeGenUtil.resolveNamedValue(value, lookupContext, mode);
return Optional.of(((ListValue) resolved).getOwnedListElements().stream().map(element1 -> {
PropertyExpression resolved1 = CodeGenUtil.resolveNamedValue(element1, lookupContext, mode);
return ((ListValue) resolved1).getOwnedListElements().stream().map(element2 -> {
PropertyExpression resolved2 = CodeGenUtil.resolveNamedValue(element2, lookupContext, mode);
return SupportedConnectionPatterns.valueOf(resolved2);
}).collect(Collectors.toList());
}).collect(Collectors.toList()));
} catch (PropertyNotPresentException e) {
return Optional.empty();
}
}
Aggregations