public final class MetaInfo extends Object
This is effectively an internal class and should not be used directly.
MetaInfo can be set on composites during the assembly phase, a.k.a the bootstrap process. MetaInfo is any additional data that one wishes to associate at the 'class level' instead of instance level of a composite declaration.
To set the MetaInfo on a Composite, call the setMetaInfo()
methods on the various composite declaration
types, such as;
public void assemble( ModuleAssembly module )
throws AssemblyException
{
Map<String,String> properties = ...;
module.services( MyService.class ).setMetaInfo( properties );
}
which can later be retrieved by calling the metaInfo()
method on the composite itself. For the example
above that would be;
@Mixins(MyServiceMixin.class)
public interface MyService extends ServiceComposite
{
}
public abstract class MyServiceMixin
implements MyService
{
private Properties props;
public MyServiceMixin()
{
props = metaInfo( Map.class );
}
}
Modifier and Type | Method and Description |
---|---|
<T> void |
add(Class<T> infoType,
T info) |
<T> T |
get(Class<T> metaInfoType) |
void |
remove(Class serviceFinderClass) |
void |
set(Object metaInfo) |
String |
toString() |
MetaInfo |
withAnnotations(AnnotatedElement annotatedElement) |
public MetaInfo()
public MetaInfo(MetaInfo metaInfo)