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

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

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.0.0, 0.12.1
    • Component/s: Enhancer
    • Labels:
      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

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

              Dates

              • Created:
                Updated:
                Resolved: