tutorial:mixin_redirectors
This is an old revision of the document!
Mixin redirectors
introduction
Redirectors are methods that can replace method invocations, field accesses, object creation, and instanceof
checks. Redirectors are declared by @Redirect
annotations and generally look like this:
@Redirect(method = "${signatureOfMethodInWhichToRedirect}", at = @At(value = "${injectionPointReference}", target = "${signature}")) public ReturnType redirectSomeMethod(Arg0Type, arg0, Arg1Type arg1) { MyClass.doMyComputations(); return computeSomethingElse(); }
Refer to the specific redirection tutorials for information about injection point references:
tutorial/mixin_redirectors.1597626619.txt.gz · Last modified: 2020/08/17 01:10 by user11681