Hi what is common is to just use CSV or associated (see xbean for instance - http://grepcode.com/file/repo1.maven.org/maven2/org.apache.xbean/xbean-reflect/3.4.3/org/apache/xbean/propertyeditor/AbstractCollectionConverter.java#AbstractCollectionConverter and http://grepcode.com/file/repo1.maven.org/maven2/org.apache.xbean/xbean-reflect/3.4.3/org/apache/xbean/propertyeditor/CollectionUtil.java#CollectionUtil.toList%28java.lang.String%2Cjava.beans.PropertyEditor%29) and let the type be selected at runtime
List<Long> longs = typedConfig.read(new TypeLitteral(List.class, Long.class)); This is the most common API and it has a big advantage: no impl link, it can be used different in several apps and can be used by any language. Romain Manni-Bucau @rmannibucau http://www.tomitribe.com http://rmannibucau.wordpress.com https://github.com/rmannibucau 2015-01-06 10:44 GMT+01:00 Anatole Tresch <[email protected]>: > Hi Oliver > > good point! We are well aware that support for Collection is a wanted > feature, but we did not yet started the discussion ;) > One aspects is also: how the representation on property value side should > be. Basically we can have adapters registered, which convert to a list and > based on the format recursively acquire adapters for the content type. So > we could also do something like: > > > - > myList={[type=java.util.ArrayList,contentType=java.lang.Integer]1,2,3,4,5} > > > ...or we can just define the type of collection only and let the adapter, > call decide which collection implementation should be returned: > > - Lists: myList=[list:a.b.MyNumberType]{1,2,3,4} > - Sets: mySet=[set:Integer]{1,2,3,4} > - Map: myMap=[map:String,Integer]{1,2,3,4} > > ...or we can just let Tamaya figure out, what it is and help with optional > metadata- entries: > > - Lists (default): myList={1,2,3,4} > - Sets: mySet={1,2,3,4} mySet[meta]=type=java.util.Set > - Map: myMap={a:1:,b:2,c:3,d:4} myMap > [meta]=type=java.util.ConcurrentHashMap,valueType=java.lang.Integer > > Or... > > > - your creativity is required... > > > > > 2015-01-06 9:07 GMT+01:00 Oliver B. Fischer <[email protected]>: > >> Currently we can only retrieve a single property by >> Configuration.get(...). But how to get a list of values from a >> configuration? IMHO we need something like getList(String prefix, Class<?> >> type) in Configuration. >> >> Otherwise don't see an eays way to get a list of values for a property. >> How can we with the current interface implement a use like this one: Give >> all mail addresses I have to notify in case of an error? >> >> Oliver >> >> -- >> N Oliver B. Fischer >> A Schönhauser Allee 64, 10437 Berlin, Deutschland/Germany >> P +49 30 44793251 >> M +49 178 7903538 >> E [email protected] >> S oliver.b.fischer >> J [email protected] >> X http://xing.to/obf >> >> > > > -- > *Anatole Tresch* > Java Engineer & Architect, JSR Spec Lead > Glärnischweg 10 > CH - 8620 Wetzikon > > *Switzerland, Europe Zurich, GMT+1* > *Twitter: @atsticks* > *Blogs: **http://javaremarkables.blogspot.ch/ > <http://javaremarkables.blogspot.ch/>* > > *Google: atsticksMobile +41-76 344 62 79*
