Uploaded image for project: 'Stanbol (Retired)'
  1. Stanbol (Retired)
  2. STANBOL-1346

Provide Helper Methods for parsing Map<String,Object> configurations

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 1.0.0, 0.12.1
    • Enhancer
    • None

    Description

      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

          + 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>
      

      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

      Attachments

        Activity

          People

            rwesten Rupert Westenthaler
            rwesten Rupert Westenthaler
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: