@Documented @Retention(value=RUNTIME) @Target(value=TYPE) public @interface SupersedesService
For example, assume there was a service interface or class A. It was superseded by
B extends A which is annotated with @SupersedesService(A.class). A becomes deprecated.
The first step in migration is to change all users for A to B.
This is where SupersedesService annotation comes into play, since Services will
find providers for A, if being requested to find providers of B.
As soon as
all users of the service had migrated, providers can start providing B instead of A.
As soon as all providers had migrated, deprecated A can be removed altogether.
| Modifier and Type | Required Element and Description |
|---|---|
Class<?> |
value
Type that was superseded by a type with this annotation.
|
| Modifier and Type | Optional Element and Description |
|---|---|
String |
adapterMethod
The old-to-new static conversion method name to use when the old type
(referenced to by
value()) does not extend the new one that is being annotated. |
public abstract Class<?> value
public abstract String adapterMethod
value()) does not extend the new one that is being annotated.
This method names has to correspond to a static method with one argument of type
that is equal to value() of this annotation.Copyright © 2002–2025 Devexperts LLC. All rights reserved.