@Documented @Retention(value=SOURCE) @Target(value=TYPE) public @interface ComponentSpecification
ComponentSpecification is used to annotate the specification (should be an interface) of a component (or
better a part of it). 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.
@ComponentSpecification
public interface MyComponent { ... }
and
@Then you can simply do this in your code:ComponentSpecification(plugin=true) public interface MyPlugin { ... }
@For simplicity all implementations of such component in this project have to beNamedpublic class MyClass { ... @Injectpublic void setMyComponent(MyComponent component) { ... } ... @Injectpublic void setMyPlugins(List<MyPlugins> plugins) { ... } }
stateless and thread-safe. Otherwise this has to be documented as an explicit WARNING.Ioc| Modifier and Type | Optional Element and Description |
|---|---|
boolean |
plugin
true if multiple implementations of this "component" are (potentially) expected at a time. |
Copyright © 2001–2016 mmm-Team. All rights reserved.