JakeWharton/butterknife — pull request #9 by nicopico-dev (2013-03-10 00:45:19+00:00)
Title: @InjectExtra annotation

Added an @InjectExtra annotation (heavily inspired by your @InjectView one), with ability to declare it optional.

This is my first attempt with annotation and code generation, so if anything is suboptimal or just plain wrong, please tell me :)

Here is a use example:

public class HelloActivity extends Activity {
public static final String EXTRA_MANDATORY = "EXTRA_MANDATORY";
public static final String EXTRA_OPTIONAL = "EXTRA_OPTIONAL";

@InjectExtra(EXTRA_MANDATORY)
String mandatoryExtra;
@InjectExtra(value = EXTRA_OPTIONAL, optional = true)
String optionalExtra = "Hello!"; // default value

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.hello_activity);

Extras.inject(this);
// Do something with extra values
}
}