Class ShadowDecorator
java.lang.Object
org.robolectric.internal.bytecode.ShadowDecorator
- All Implemented Interfaces:
ClassInstrumentor.Decorator
@AutoService(Decorator.class) @Priority(-2147483648) public class ShadowDecorator extends Object implements ClassInstrumentor.Decorator
Decorator which adds Robolectric's shadowing behavior to a class.
-
Constructor Summary
Constructors Constructor Description ShadowDecorator()
-
Method Summary
Modifier and Type Method Description void
decorate(MutableClass mutableClass)
void
decorateMethodPreClassHandler(MutableClass mutableClass, org.objectweb.asm.tree.MethodNode originalMethod, String originalMethodName, RobolectricGeneratorAdapter generator)
For non-invokedynamic JVMs, generates this code:
-
Constructor Details
-
ShadowDecorator
public ShadowDecorator()
-
-
Method Details
-
decorate
- Specified by:
decorate
in interfaceClassInstrumentor.Decorator
-
decorateMethodPreClassHandler
public void decorateMethodPreClassHandler(MutableClass mutableClass, org.objectweb.asm.tree.MethodNode originalMethod, String originalMethodName, RobolectricGeneratorAdapter generator)For non-invokedynamic JVMs, generates this code:if (__robo_data__ instanceof ThisClass) { try { return __robo_data__.$$robo$$originalMethod(params); } (Throwable t) { throw RobolectricInternals.cleanStackTrace(t); } }
Note that this method is only called byOldClassInstrumentor
.- Specified by:
decorateMethodPreClassHandler
in interfaceClassInstrumentor.Decorator
-