You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@stanbol.apache.org by "Rupert Westenthaler (JIRA)" <ji...@apache.org> on 2014/05/27 09:51:02 UTC
[jira] [Resolved] (STANBOL-1346) Provide Helper Methods for parsing
Map configurations
[ https://issues.apache.org/jira/browse/STANBOL-1346?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Rupert Westenthaler resolved STANBOL-1346.
------------------------------------------
Resolution: Fixed
implemented with http://svn.apache.org/r1597575 in 0.12 and merged with http://svn.apache.org/r1597711 to trunk (1.0.0-SNAPSHOT)
> Provide Helper Methods for parsing Map<String,Object> configurations
> --------------------------------------------------------------------
>
> Key: STANBOL-1346
> URL: https://issues.apache.org/jira/browse/STANBOL-1346
> Project: Stanbol
> Issue Type: Improvement
> Components: Enhancer
> Reporter: Rupert Westenthaler
> Assignee: Rupert Westenthaler
> Fix For: 1.0.0, 0.12.1
>
>
> This issue tracks improvements to the EnhancementEngineHelper implemented as part of STANBOL-488 (EnhancementProperties) and STANBOL-1334, STANBOL-1334 (DereferenceEngine) that are also useful for any other EnhancementEngine that requires to parse
> * OSGI component configuration (using Dictionary<String,Object>)
> * Enhancement properties (using Map<String, Object>).
> The EnhancementEngineHelper will be extended by the following type of static utility methods
> {code}
> + parseConfigValues(Object value, Class<T> type) : Collection<T>
> + parseFistConfigValue(Object value, Class<T> type) : T
> + getConfigValues(Dictionary<String,Object> config, String property, Class<T> type) : Collection<T>
> + getConfigValues(EnhancementEngine ee, ContentItem ci,
> Map<String,Object> enhProp, String property, Class<T> type) Collection<T>
> {code}
> All methods will:
> * return NULL if NULL is parsed as config value or the parsed configuration does not contain the requested property
> * support Arrays and Collections for multiple values.
> * support Arrays of primitive types
> Additional optional parameters (for all methods)
> * `String preserveNullValues`: if null values should be preserved. By default those will get removed.
> * `Collection<T> addTo`: Allows to parse the collection to be filled with the configuration values
--
This message was sent by Atlassian JIRA
(v6.2#6252)