org.xwiki.component.annotation
Annotation Type Requirement


Deprecated. starting with 3.1M1 use the JSR330 Inject and Named annotations instead

@Documented
@Retention(value=RUNTIME)
@Target(value=FIELD)
@Inherited
@Deprecated
public @interface Requirement

Defines a field or method that needs to be injected with a component. A hint can be specified to choose which implementation to use.

Since:
1.8.1
Version:
$Id: f6faf22bdae3bcc57ddac4bc24f9918b8938c63e $

Optional Element Summary
 String[] hints
          Deprecated. When injecting a Collection of requirements, allows specifying a discrete list of hints to use.
 Class<?> role
          Deprecated. since 2.7RC1 generic types are guessed too
 String value
          Deprecated. The hint value selecting a specific component implementation to use.
 

value

public abstract String value
Deprecated. 
The hint value selecting a specific component implementation to use.

Default:
""

role

@Deprecated
public abstract Class<?> role
Deprecated. since 2.7RC1 generic types are guessed too

The role for the component to inject. Note that the role can usually be guessed from the field type or method parameter type. However, for Lists or Maps we need to pass it since Java doesn't allow getting it using reflection.

Default:
java.lang.Object.class

hints

public abstract String[] hints
Deprecated. 
When injecting a Collection of requirements, allows specifying a discrete list of hints to use. If these are not specified, then all implementations for the specified role will be injected.

Default:
{}


Copyright © 2004-2011 XWiki. All Rights Reserved.