roboguice.inject
Annotation Type InjectExtra
@Retention(value=RUNTIME)
@Target(value={FIELD,PARAMETER,METHOD})
public @interface InjectExtra
Indicates that a variable member of a class (whether static or not) should be
injected with an Android extra. The value is compulsory, and correspond to
the key of the extra.
The extra must exists when the activity is injected, unless you specify
optional=true
in the InjectExtra
annotation. If optional is
set to true and no extra is found, no value will be injected in the field.
The default behavior of the InjectExtra
annotation is to forbid null
values. However, if you wish to allow injection of null values, you should
use the Nullable
annotation.
You can define a default value in Java when the extra is optional :
{@code
- Author:
- Mike Burton
Optional Element Summary |
boolean |
optional
|
value
public abstract String value
optional
public abstract boolean optional
- Default:
- false
Copyright © 2011. All Rights Reserved.