Announcement Announcement Module
Collapse
No announcement yet.
property override configurer for a complex map Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • property override configurer for a complex map

    Hi everyone.

    I have a bean with a map<String, List<String>>
    I would like to override it with a property override configurer, but I don't know the syntax to use.
    If my default map looks like CLIENT:["read"],ADMIN:["read","update","delete"] I would like to be able to override it to look like CLIENT:["read","update"],ADMIN:["read,"update","create","delete"],ANONYMOUS:["read"]

    my xml looks like this:
    Code:
    <util:map id="defaultMap" map-class="java.util.HashMap">
    		<entry key="CLIENT">
    			<list>
    				<value>READ:{realm}</value>
    			</list>
    		</entry>
    		<entry key="ADMIN">
    			<list>
    				<value>READ:{realm}</value>
    				<value>UPDATE:{realm}</value>
    				<value>DELETE:{realm}</value>
    			</list>
    		</entry>
    	</util:map>
    	
    	
    	<bean name="mapHolder"
    		class="com.example.mapHolder">
    		<property name="map" ref="defaultMap"/>
    	</bean>
    
    
    
    	<bean id="propertyOverrideConfigurer" class="org.springframework.beans.factory.config.PropertyOverrideConfigurer">
    		<property name="locations">
    			<list>
    				<value>file:${user.home}/config/permission.override.properties	</value>
    			</list>
    		</property>
    	</bean>
    What should my permission.override.properties file look like? I've tried
    mapHolder.map[CLIENT]=["READ:{realm}","Hello test"]
    but I get the following:
    Code:
     Error setting property values; nested exception is org.springframework.beans.PropertyBatchUpdateException; nested PropertyAccessExceptions (1) are:
    PropertyAccessException 1: org.springframework.beans.TypeMismatchException: Failed to convert property value of type 'java.lang.String' to required type 'java.lang.String' for property 'null'; nested exception is org.eclipse.gemini.blueprint.blueprint.container.SpringBlueprintConverterService$BlueprintConverterException: No conversion found for generic argument(s) for reified type class java.lang.Stringsource type java.lang.String| targetType =class java.lang.String
Working...
X