Package crypto.typestate
Class LabeledMatcherTransition
- java.lang.Object
-
- typestate.finiteautomata.Transition
-
- typestate.finiteautomata.MatcherTransition
-
- crypto.typestate.LabeledMatcherTransition
-
- All Implemented Interfaces:
typestate.finiteautomata.ITransition
public class LabeledMatcherTransition extends typestate.finiteautomata.MatcherTransition
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static typestate.finiteautomata.MatcherTransitiongetErrorTransition(typestate.finiteautomata.State from, Collection<soot.SootMethod> matchingMethods, typestate.finiteautomata.MatcherTransition.Parameter param, typestate.finiteautomata.State to, typestate.finiteautomata.MatcherTransition.Type type)Optional<CrySLMethod>getMatching(soot.SootMethod method)Return theCrySLMethod's that match the given method.static LabeledMatcherTransitiongetTransition(typestate.finiteautomata.State from, Collection<CrySLMethod> label, typestate.finiteautomata.MatcherTransition.Parameter param, typestate.finiteautomata.State to, typestate.finiteautomata.MatcherTransition.Type type)static booleanisSubtype(soot.SootClass child, soot.SootClass parent)Returns whether parent is a super type of child, i.e.booleanmatches(soot.SootMethod method)The matches method ofMatcherTransitionmatches Methods taken from someInvokeExpr's.static booleanmatches(soot.SootMethod called, soot.SootMethod declared)Match the called method against a declared method and checker whether the called method could actually be the declared one.StringtoString()
-
-
-
Method Detail
-
getTransition
public static LabeledMatcherTransition getTransition(typestate.finiteautomata.State from, Collection<CrySLMethod> label, typestate.finiteautomata.MatcherTransition.Parameter param, typestate.finiteautomata.State to, typestate.finiteautomata.MatcherTransition.Type type)
-
getErrorTransition
public static typestate.finiteautomata.MatcherTransition getErrorTransition(typestate.finiteautomata.State from, Collection<soot.SootMethod> matchingMethods, typestate.finiteautomata.MatcherTransition.Parameter param, typestate.finiteautomata.State to, typestate.finiteautomata.MatcherTransition.Type type)
-
matches
public static boolean matches(soot.SootMethod called, soot.SootMethod declared)Match the called method against a declared method and checker whether the called method could actually be the declared one.- Parameters:
called- the called methoddeclared- the declared method- Returns:
- true, if called and declared method match
-
isSubtype
public static boolean isSubtype(soot.SootClass child, soot.SootClass parent)Returns whether parent is a super type of child, i.e. if they are the same, child implements or extends parent transitively.- Parameters:
child- the child to checkparent- the parent to check against- Returns:
- true, if parent is a super type of child
-
matches
public boolean matches(soot.SootMethod method)
The matches method ofMatcherTransitionmatches Methods taken from someInvokeExpr's. The method getDeclaringClass() will return the object's class they are called on not the actual declaring class. Thus, if the class under spec does not declare the method,CrySLMethodToSootMethodwon't find a matching method with the same declaring class and the label will not contain the method. We therefore check if there is a matching Method if theMatcherTransitionreturns false. The state machine is per Class, so every method will have the same declaring class and it is correct to return true if it matches the method of *some* super-type.- Overrides:
matchesin classtypestate.finiteautomata.MatcherTransition- See Also:
MatcherTransition.matches(soot.SootMethod)
-
getMatching
public Optional<CrySLMethod> getMatching(soot.SootMethod method)
Return theCrySLMethod's that match the given method. As the method is taken from a statement, we need to apply the mathcing logic defined here, to get theCrySLMethods that were resolved to the matchingSootMethods.- Parameters:
method- the given method- Returns:
- The
CrySLMethod's matching the given soot method.
-
toString
public String toString()
- Overrides:
toStringin classtypestate.finiteautomata.MatcherTransition
-
-