net.sf.mmm.util.component.base
Annotation Type ComponentSpecification


@Documented
@Retention(value=SOURCE)
@Target(value=TYPE)
public @interface ComponentSpecification

ComponentSpecification is used to annotate the specification (should be an interface) of a component. It acts only for the purpose of documentation and has no functional impact. However it will say that you can get one (or multiple) instance(s) of this specification via injection.
If you find this:

 @ComponentSpecification
 public interface MyComponent { ... }
 
and
 @ComponentSpecification(plugin=true)
 public interface MyPlugin { ... }
 
Then you can simply do this in your code:
 @Named
 public class MyClass {
   ...
   @Inject
   public void setMyComponent(MyComponent component) { ... }
   ...
   @Inject
   public void setMyPlugins(List<MyPlugins> plugins) { ... }
   
 }
 
For simplicity all implementations of such component in this project have to be stateless and thread-safe. Otherwise this has to be documented in an explicit WARNING.

Since:
2.0.0
Author:
Joerg Hohwiller (hohwille at users.sourceforge.net)
See Also:
AnnotationConfigApplicationContext

Optional Element Summary
 boolean plugin
          true if multiple implementations of this "component" are (potentially) expected at a time.
 

plugin

public abstract boolean plugin
true if multiple implementations of this "component" are (potentially) expected at a time. In this case it is typically some sort of plugin that should be injected to a list of the annotated type.

Default:
false


Copyright © 2001-2010 mmm-Team. All Rights Reserved.