Details
-
New Feature
-
Status: Closed
-
Major
-
Resolution: Fixed
-
None
-
None
-
None
Description
This will configure a nomals-scoped bean class used to lookup a CDI bean used as converter for the configuration:
@Inject @ConfigProperty(name = "urlListFromProperties", converter = UrlList.class) private List<URL> urlListFromProperties;
assuming we have:
public class UrlList implements ConfigResolver.Converter<List<URL>> { @Override public List<URL> convert(final String value) { final List<URL> urls = new ArrayList<URL>(); if (value != null) { for (final String segment : value.split(",")) { try { urls.add(new URL(segment)); } catch (final MalformedURLException e) { throw new IllegalArgumentException(e); } } } return urls; } }