Annotation Interface Argument
An annotation used to specify arguments to be injected into
InjectedCommands.-
Optional Element Summary
Optional ElementsModifier and TypeOptional ElementDescriptionbooleanSpecifies whether to allow additional matching elements in the context.Specifies the class to be matched.booleanSpecifies whether the elements eligible for this argument must match the declared type or the type specified bymatch()exactly or if sub-classes are allowed as well.booleanSpecifies whether the argument is optional.
-
Element Details
-
optional
boolean optionalSpecifies whether the argument is optional. For scalar arguments this means that they may benull, forCollectionvalued arguments the collection may be empty.- Returns:
trueif the argument is optional.
- Default:
false
-
allowOtherMatches
boolean allowOtherMatchesSpecifies whether to allow additional matching elements in the context. This parameter is used for scalar arguments only. If this is set totrue, additional matches for a scalar argument are ignored, i.e. the command "sees" only the first match for the argument. If set tofalse, the command becomes invalid if there is more than one match for the argument.- Returns:
trueif additional matches are allowed,falseotherwise.
- Default:
true
-
match
Specifies the class to be matched. Normally, the class to be matched is extracted from the method parameter or field type that is annotated by this annotation. In some cases, however, it may be desirable to match only a sub-class or implementor of the declared type. Caveat: the declared field/parameter type must be assignable from the specified match class.- Returns:
- the match class to be used.
- Default:
com.levigo.jadice.web.client.util.command.Argument.class
-
matchSubclasses
boolean matchSubclassesSpecifies whether the elements eligible for this argument must match the declared type or the type specified bymatch()exactly or if sub-classes are allowed as well.- Returns:
trueif sub-classes are also eligible for injection to the annotated argument.
- Default:
true
-