@Documented
@Retention(value=RUNTIME)
@Target(value=TYPE)
public @interface 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.
Modifier and Type | Optional Element and Description |
---|---|
boolean |
callThroughByDefault
If true, Robolectric will invoke the actual Android code for any method that isn’t shadowed.
|
java.lang.String |
className
Android class name (if the Class object is not accessible).
|
boolean |
inheritImplementationMethods
Deprecated.
Declare methods directly in your shadow class rather than relying on inheritance.
|
boolean |
isInAndroidSdk
Denotes that this type exists in the public Android SDK.
|
boolean |
looseSignatures
If true, when an exact method signature match isn’t found, Robolectric will look for a method with the same name but with all argument types replaced with java.lang.Object.
|
int |
maxSdk
If specified, the shadow class will be applied only for this SDK or lesser.
|
int |
minSdk
If specified, the shadow class will be applied only for this SDK or greater.
|
java.lang.Class<?> |
value
The Android class to be shadowed.
|
public abstract java.lang.Class<?> value
The Android class to be shadowed.
public abstract java.lang.String className
Android class name (if the Class object is not accessible).
public abstract boolean isInAndroidSdk
Denotes that this type exists in the public Android SDK. When this value is true, the annotation processor will generate a shadowOf method.
public abstract boolean callThroughByDefault
If true, Robolectric will invoke the actual Android code for any method that isn’t shadowed.
@Deprecated public abstract boolean inheritImplementationMethods
If true, Robolectric will invoke @Implementation
methods from superclasses regardless of what class the superclass @Implement
s.
This is inadvisable because Robolectric might pick an @Implementation method that’s intended to implement a different class (e.g. an overridden method with the same signature from a superclass) than the one requested.
public abstract boolean looseSignatures
If true, when an exact method signature match isn’t found, Robolectric will look for a method with the same name but with all argument types replaced with java.lang.Object.