To get configurations as maps I created a DataServiceBuilder, which looks a 
little bit
ugly but works very well. Hivemind looks like:
 
<service-point id="TestMap" interface="java.util.Map">
 <invoke-factory 
service-id="spirit.core.base.servicebuilder.DataServiceBuilder">
  <for-each source="Test" target="java.util.HashMap">
   <do method="put">
    <parameter property="key"/>
    <parameter property="value"/>
   </do>
  </for-each>
 </invoke-factory>
</service-point>  
 
<configuration-point id="Test" schema-id="spirit.core.base.schemes.Property"/>
 
<contribution configuration-id="Test">
 <item key="1" value="eins"/>
 <item key="2" value="zwei"/>
</contribution>

The service-point gives a java.util.Map, which ist constructed from the 
configuration "Test", 
by iterating over the list and applying the method "put" on a 
"java.util.HashMap" with the
parameters of the lists item (mapping object) key and value. If a property 
value is "*" than
the whole mapping object is applied.
 
This is just another way to achive that without extending hivemind syntax.
 
Stefan
 

________________________________

Von: Knut Wannheden [mailto:[EMAIL PROTECTED]
Gesendet: Sa 29.01.2005 10:49
An: [email protected]; Howard Lewis Ship
Betreff: Re: Configurations as Maps .. attribute value or property value



Howard,

On Fri, 28 Jan 2005 13:21:41 -0500, Howard Lewis Ship <[EMAIL PROTECTED]> wrote:
> Just a thought for discussion.  I'm looking at Knut's code for
> converting configurations to maps. One thing that nags me is that it
> uses the raw attribute value as the key.
>
> Not sure that is best; I think the translated value for that attribute
> is the right thing.
>
That sounds like a very reasonable change. Didn't think of that at the time.

--knut

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to