@Target(value={TYPE,METHOD})
@Retention(value=RUNTIME)
@Repeatable(value=Descriptors.class)
public @interface Desc
A descriptor for matching a target element, for details of usage see
DynamicSelectorDesc.
Unlike Explicit Target Selectors which can match any
element of a candidate member, @Desc descriptors always match
all elements of a target explicitly. Element defaults are as follows:
owner()- Defaults to the current target of the mixin if not specified
ret()- Defaults to void
args()- Defaults to an empty array matching a target with no arguments, omitting this value does not mean "match any" signature and will explicitly match targets with no arguments. This value is ignored for fields.
| Modifier and Type | Required Element and Description |
|---|---|
java.lang.String |
value
The name of the member to match.
|
| Modifier and Type | Optional Element and Description |
|---|---|
java.lang.Class<?>[] |
args
The argument types of a method to match, ignored for fields.
|
java.lang.String |
id
The identifier for this descriptor.
|
int |
max
The maximum number of times this selector can match.
|
int |
min
The minimum number of times this selector should match.
|
java.lang.Class<?> |
owner
The owner of the member to match.
|
java.lang.Class<?> |
ret
The return type of a method to match, or the declared type of a field.
|
public abstract java.lang.String value
public abstract java.lang.String id
DynamicSelectorDesc.public abstract java.lang.Class<?> owner
When owner is not specified, it defaults to the current target of the mixin.
public abstract java.lang.Class<?> ret
public abstract java.lang.Class<?>[] args
public abstract int min
@At.desc) this allows a minimum number of matches to
be specified in order to provide early validation that the selector
matched the correct number of candidates. To specify an exact number of
matches, set max to the same value as min. Values
less than zero are ignored since selectors cannot match a negative number
of times.public abstract int max
@At.desc) this allows a
maximum number of matches to be specified in order to limit the number of
times that the selector can match candidates. To specify an exact number
of matches, set max to the same value as min.
Values less than 1 are treated as Integer.MAX_VALUE (the
default) since setting a value of 0 or less has no meaning.