Hi All,

I am using Felix SCR annotations v1.7.0 and Maven SCR plugin 1.8.0, and
declaring a OSGi property as:

@Property(label="Multivalued Property", value={"only-single-value"})
private static final String MV_PROPERTY= "multivalued.property";

And then try to retrieve the property value as:


@Activate
@Modified
protected void activate(*final ComponentContext context*) throws Exception {
   Object prop = context.getProperties().get(MV_PROPERTY);
}



But I observe that the value is retrieved as a String and not a String
array. The generated SCR xml itself is generated for a String and not a
String array.
 <property name="multivalued.property" value="only-single-value"/>

However, if I declare the property as below, I get the value as an array.

@Property(label="Multivalued Property", value={"only-single-value"*, ""*})
private static final String MV_PROPERTY= "multivalued.property";

I Googled around but could not find anything conclusive. Am I missing
something here? How can I get a String array without a workaround done
above.

-- 
Thanks,
/Thomas Joseph

Reply via email to