@Target(value=FIELD) @Retention(value=RUNTIME) public @interface link
@link
to automatically transfer calls on unimplemented interface methods to fields in the same class.
@part
part
classes (solves the Self problem)
class MyClass implements MyInterface {
@link MyInterface myInterface; // transfers calls on MyInterface to myInterface
public MyClass(MyInterface myInterface) {
this.myInterface = myInterface; // dynamically configure behavior
}
}
Modifier and Type | Optional Element and Description |
---|---|
Class<?>[] |
share
Where interface overlap exists with other links, this list of interfaces resolves which links to use.
|
boolean |
shareAll
If true, indicates this link is shared where interface overlap exists with other links.
|
Class<?>[] |
value
Specify interfaces to link.
|
public abstract Class<?>[] value
public abstract Class<?>[] share
public abstract boolean shareAll
share()
,
but includes all interfaces from this link that overlap.Copyright © 2024. All rights reserved.