Commit b1a39311 authored by Anna Maria Schmitz's avatar Anna Maria Schmitz

add SomeIPTagHelper

parent 272ba097
Pipeline #177753 failed with stages
in 2 minutes and 27 seconds
/* (c) https://github.com/MontiCore/monticore */
package de.monticore.lang.monticar.generator.someip.helper;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarc._symboltable.cncModel.EMAPortSymbol;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarc._symboltable.instanceStructure.EMAComponentInstanceSymbol;
import de.monticore.lang.embeddedmontiarc.tagging.middleware.someip.SomeIPConnectionSymbol;
import de.monticore.lang.tagging._symboltable.TagSymbol;
import de.monticore.lang.tagging._symboltable.TaggingResolver;
import java.util.*;
public class SomeIPTagHelper {
private SomeIPTagHelper() {
}
public static Map<EMAPortSymbol, SomeIPConnectionSymbol> resolveTags(TaggingResolver taggingResolver, EMAComponentInstanceSymbol componentInstanceSymbol) {
Map<EMAPortSymbol, SomeIPConnectionSymbol> someIPConnectionSymbols = new HashMap<>();
componentInstanceSymbol.getPortInstanceList().forEach(p -> {
Collection<TagSymbol> tmpTags = taggingResolver.getTags(p, SomeIPConnectionSymbol.KIND);
if (tmpTags.size() == 1) {
someIPConnectionSymbols.put(p, (SomeIPConnectionSymbol) tmpTags.iterator().next());
}
});
componentInstanceSymbol.getSubComponents().forEach(sc -> someIPConnectionSymbols.putAll(SomeIPTagHelper.resolveTags(taggingResolver, sc)));
return someIPConnectionSymbols;
}
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment