[
https://issues.apache.org/jira/browse/FELIX-4034?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Clement Escoffier resolved FELIX-4034.
--------------------------------------
Resolution: Fixed
Fixed in trunk, documentation in progress
> Instance configuration DSL
> --------------------------
>
> Key: FELIX-4034
> URL: https://issues.apache.org/jira/browse/FELIX-4034
> Project: Felix
> Issue Type: New Feature
> Components: iPOJO
> Reporter: Clement Escoffier
> Assignee: Clement Escoffier
> Fix For: ipojo-runtime-1.10
>
>
> Provides a DSL to declare instances without relying on XML.
> This DSL looks like a fluent API using in classes annotated with the
> @Configuration annotation:
> @Configuration
> public class MyInstances {
> Instance i1 = instance().of("my.factory")
> .with("simple").setto("simple");
> Instance i2 = instance()
> .of("my.factory")
> .with("simple").setto("simple")
> .with("list").setto(list(1, 2, 3))
> .with("list2").setto(list().with(1).with(2).with(3))
> .with("map").setto(map().with(pair("entry", "value")))
> .with("map").setto(map()
> .with(pair("entry2", list("aaa", "bbb"))));
> }
> Methods returning instances should also be called (receiving an optional
> bundle context). Thus we can add some logic computing the instance
> configuration.
> The DSL creates an instance declaration and not just an instance. It's
> equivalent to the <instance/> XML declaration.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira