Class ThreatPatternConversion

java.lang.Object
be.kuleuven.cs.distrinet.sparta.core.patterns.ThreatPatternConversion

public class ThreatPatternConversion extends Object
Renders the (long) description of a ThreatPattern for a concrete IPatternMatch by substituting parameter placeholders with values from the match.

Placeholder syntax:

  • <$name$> — replaced with the name (ModelElement.getName()) of the match parameter called name;
  • <$name.type$> — replaced with the model type of that parameter (the element's class name without the EMF Impl suffix, e.g. Process). type is the only supported attribute; any other attribute renders as UNSUPPORTED ATTRIBUTE.

Substitution is literal: replacement values containing regex-special characters such as $ or \ are inserted as-is. When a placeholder references a parameter that is absent from the match (or that is not a ModelElement), it renders as the visible marker <unknown: name> instead of failing the whole conversion.

  • Constructor Details

    • ThreatPatternConversion

      public ThreatPatternConversion(ThreatPattern meta, org.eclipse.viatra.query.runtime.api.IPatternMatch match)
  • Method Details

    • getDescription

      public String getDescription()
    • getLongDescription

      public String getLongDescription()
    • processAndReplaceParams

      public String processAndReplaceParams(String src)
    • processMatch

      protected String processMatch(MatchResult mr)
    • getProperty

      protected String getProperty(MatchResult mr)
    • getElementFromMatch

      protected <T> T getElementFromMatch(Class<? extends T> clz, String name)
    • getThreatLocation

      public DFDElement getThreatLocation()
    • getDataFlow

      public DataFlow getDataFlow()
    • map

      protected String map(String name)