Annotation Interface Argument
An annotation used to specify arguments to be injected into
InjectedCommand
s.-
Optional Element Summary
Optional ElementsModifier and TypeOptional ElementDescriptionboolean
Specifies whether to allow additional matching elements in the context.Specifies the class to be matched.boolean
Specifies 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.boolean
Specifies whether the argument is optional.
-
Element Details
-
optional
boolean optionalSpecifies whether the argument is optional. For scalar arguments this means that they may benull
, forCollection
valued arguments the collection may be empty.- Returns:
true
if 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:
true
if additional matches are allowed,false
otherwise.
- 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:
true
if sub-classes are also eligible for injection to the annotated argument.
- Default:
- true
-