Package org.robolectric.annotation
Annotation Type Implements
Indicates that a class declaration is intended to shadow an Android class declaration. The
Robolectric runtime searches classes with this annotation for methods with the
Implementation annotation and calls them in place of the methods on the Android class.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceAn interface used as the default for thepickerparam. -
Optional Element Summary
Optional ElementsModifier and TypeOptional ElementDescriptionbooleanThis method has precedence over the default behavior of calling through to real code.@NonNull StringAndroid class name (if the Class object is not accessible).booleanDenotes that this type exists in the public Android SDK.intIf specified, the shadow class will be applied only for this SDK or lesser.intIf specified, the shadow class will be applied only for this SDK or greater.@NonNull Class<? extends ShadowPicker<?>> If specified, thepickerwill be instantiated and called from within the newly-created Robolectric classloader.@NonNull Class<?> The Android class to be shadowed.
-
Element Details
-
value
@NonNull Class<?> valueThe Android class to be shadowed.- Returns:
- Android class to shadow.
- Default:
void.class
-
className
@NonNull String classNameAndroid class name (if the Class object is not accessible).- Returns:
- Android class name.
- Default:
""
-
isInAndroidSdk
boolean isInAndroidSdkDenotes that this type exists in the public Android SDK. When this value is true, the annotation processor will generate a shadowOf method.- Returns:
- True if the type is exposed in the Android SDK.
- Default:
true
-
minSdk
int minSdkIf specified, the shadow class will be applied only for this SDK or greater.- Default:
-1
-
maxSdk
int maxSdkIf specified, the shadow class will be applied only for this SDK or lesser.- Default:
-1
-
shadowPicker
@NonNull Class<? extends ShadowPicker<?>> shadowPickerIf specified, thepickerwill be instantiated and called from within the newly-created Robolectric classloader. All shadow classes implementing the same Android class must use the sameShadowPicker.- Default:
org.robolectric.annotation.Implements.DefaultShadowPicker.class
-
callNativeMethodsByDefault
boolean callNativeMethodsByDefaultThis method has precedence over the default behavior of calling through to real code. For instance, if this method is true, the native method variant will be preferred over the no-op native variant.- Default:
false
-