You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tapestry.apache.org by "Norbert Sándor (JIRA)" <ta...@jakarta.apache.org> on 2006/07/15 22:37:15 UTC

[jira] Commented: (TAPESTRY-725) @InjectObject is unable to inject configurations as Map

    [ http://issues.apache.org/jira/browse/TAPESTRY-725?page=comments#action_12421340 ] 
            
Norbert Sándor commented on TAPESTRY-725:
-----------------------------------------

How about some workaround: if the property type is a Map and the configuration point is accessible as a map then it is accessed as Registry.getConfigurationAsMap() instead of Registry.getConfiguration().

Regards:
Norbi

> @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: dev-unsubscribe@tapestry.apache.org
For additional commands, e-mail: dev-help@tapestry.apache.org