Package sootup.core.frontend
Class OverridingBodySource
java.lang.Object
sootup.core.frontend.OverridingBodySource
- All Implemented Interfaces:
BodySource
Allows for replacing specific parts of a method or, resolve methods where all information is
already existing.
When replacing specific parts of a method by default, it delegates to the BodySource
delegate provided in the constructor.
To alter the results of invocations to e.g. resolveBody(Iterable), simply call withBody(Body) to obtain a new OverridingBodySource. The new instance will then use the
supplied value instead of calling resolveBody(Iterable) on the delegate.
-
Constructor Summary
ConstructorsConstructorDescriptionOverridingBodySource(@NonNull BodySource delegate) OverridingBodySource(@NonNull MethodSignature methodSignature, @NonNull Body body) Method source where all information already available -
Method Summary
Modifier and TypeMethodDescription@NonNull MethodSignature@NonNull BodyresolveBody(@NonNull Iterable<MethodModifier> modifiers) Returns a filled-out body for the given SootMethod.@NonNull OverridingBodySource
-
Constructor Details
-
OverridingBodySource
-
OverridingBodySource
Method source where all information already available
-
-
Method Details
-
resolveBody
Description copied from interface:BodySourceReturns a filled-out body for the given SootMethod. This may be an expensive operation.- Specified by:
resolveBodyin interfaceBodySource- Parameters:
modifiers- The collection of modifiers which are needed by BodyInterceptors to modify the body accordingly.- Throws:
IOException
-
resolveAnnotationsDefaultValue
- Specified by:
resolveAnnotationsDefaultValuein interfaceBodySource- Returns:
- returns the default value of the Annotation for this method
-
getSignature
- Specified by:
getSignaturein interfaceBodySource
-
withBody
-