Rupert Westenthaler created STANBOL-1346:
--------------------------------------------

             Summary: 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)

* {noformat}String preserveNullValues{noformat}: if null values should be 
preserved. By default those will get removed.
* {noformat}Collection<T> addTo{noformat}: Allows to parse the collection to be 
filled with the configuration values



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Reply via email to