@Target(value={METHOD,FIELD,PARAMETER})
@Retention(value=RUNTIME)
@Qualifier
@Documented
public @interface Delegated
public interface MyHandler {
// handle things...
}
public class MyDefaultHandler implements MyHandler {
// implementations...
}
public class MyHandlerDecorator implements MyHandler {
@Inject @Delegated private MyHandler delegate;
}
Configured as
// this is the delegated handler bind(MyHandler.class).markedWith(Delegated.class).to(MyDefaultHandler.class); // this is the decorator bind(MyHandler.class).to(MyHandlerDecorator.class);
The annotation isn't used in the library, but it's added here because many users of syringe (old trew) added this annotation to its projects and used it as specified.