[ http://issues.apache.org/jira/browse/TAPESTRY-725?page=all ]
Andreas Andreou updated TAPESTRY-725:
-------------------------------------
Component/s: Framework
Affects Version/s: 4.1
> @InjectObject is unable to inject configurations as Map
> -------------------------------------------------------
>
> Key: TAPESTRY-725
> URL: http://issues.apache.org/jira/browse/TAPESTRY-725
> Project: Tapestry
> Issue Type: Bug
> Components: Annotations, Framework
> Affects Versions: 4.0, 4.1
> Environment: 4.0b11
> Reporter: Norbert Sándor
> Fix For: unspecified
>
>
> I have a configuration point which can be retrieved as a Map:
> <configuration-point id="ObjectVisualizers">
> <schema>
> <element name="visualizer" key-attribute="type">
> <attribute name="type" required="true" translator="class"/>
> <attribute name="implementation" required="true" translator="object" />
> <rules>
> <push-attribute attribute="implementation"/>
> <invoke-parent method="addElement"/>
> </rules>
> </element>
> </schema>
> </configuration-point>
> Hivemind handles it correctly as Registry.getConfigurationAsMap() returns the
> expected value.
> But
> @InjectObject(value="configuration:mymodule.ObjectVisualizers")
> public abstract Map getObjectVisualizers();
> results in an exception:
> org.apache.tapestry.BindingException
> An error occured processing annotation
> @org.apache.tapestry.annotations.InjectObject(value=configuration:mymodule.ObjectVisualizers)
> of public abstract java.util.Map mypackage.Component.getObjectVisualizers():
> The value obtained using locator 'configuration:mymodule.ObjectVisualizers'
> ([...]) is not compatible with the existing property (of type java.util.Map).
> because as I see InjectObjectWorker does not check the property type, so
> injecting a configuration is allowed only as a List.
> BR,
> Norbi
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]