@Bean(name="SomeBean")
@Aliases(name="ABean")
public class MyBean
{
long age;
String property;
@Constructor
public MyBean(@StringValue(value="25", type="long") long age)
{
...
}
@StringValue(value="Hello", type="java.lang.String")
public void setProperty(String property)
{
this.property = property;
}
}
If this class is compiled, we can use
AnnotationToBeanMetaDataFactory.createBeanMetaData(Class) to obtain the
BeanMetaData, which can then be deployed into the controller using the
KernelController.install(BeanMetaData) method.
Once deployed, we will have a bean called MyBean, with an alias ABean. The bean will
be constructed using the non-default constructor passing in 25 for the setProperty() passing in Hello as the parameter. The individual
annotations have more examples.
Package Specification
Related Documentation