Tagging a field with
@plexus.requirement will tell plexus to inject the required component or
list of components before the component itself is started. Fields can be of the type of the Interface
defining the component you wish to be injected or of type
java.util.List or
java.util.Map.
Fields of type
java.lang.List will have a list of components injected whereas a field of
type
java.lang.Map will have a mapping in the form of
role-hint -> component.
The
role parameter is required if using a
List or
Map whereas a role-hint is
not allowed.
Parameter |
Required |
Description |
role |
No. Yes if the field is a List or a Map |
The role parameter is used to tell plexus what Component role you are interested in.
For singleton fields their type is used as a default. |
role-hint |
No. Not allowed if the field is a List or a Map |
Links to the role-hint defined by a component when looking up a component.
Not allowed with List or Map fields, as they return all role-hints. |