Package io.micronaut.context.annotation
Annotation Type DefaultImplementation
-
@Documented @Retention(RUNTIME) @Target(TYPE) @Inherited public @interface DefaultImplementationAn annotation to apply to an interface to indicate which implementation is the default implementation. The initial use case is to redirect
Replacesto another class to allow the replacement of an implementation that isn't accessible due to visibility restrictions.For example:
@DefaultImplementation(MyImpl.class) public interface SomeInterface { } class MyImpl implements SomeInterface { } @Replaces(SomeInterface.class) class OtherImpl implements SomeInterface { }In the above example the
OtherImplbean will replace theMyImplbean because the class in theReplacesannotation has a default implementation.- Since:
- 1.2.0