[ http://issues.apache.org/jira/browse/TAPESTRY-725?page=all ]

Jesse Kuhnert resolved TAPESTRY-725.
------------------------------------

    Fix Version/s: unspecified
       Resolution: Incomplete

Unfortunately this is actually a hivemind bug. The class type returned from one 
of the configuration points is org.apache.hivemind.impl.ElementListProxy which 
extends java.util.AbstractList. 

We would need this instance to be an ElementMapProxy for it to work. Not sure 
why hivemind is doing it like this but that's what I'm getting. 

> @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
>    Affects Versions: 4.0
>         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]

Reply via email to