コード例 #1
0
  protected Map<Locale, Map<String, String>> getOptionLabelsMap(LocalizedValue optionLabels) {

    Map<Locale, Map<String, String>> optionLabelsMap = new HashMap<Locale, Map<String, String>>();

    for (Locale availableLocale : optionLabels.getAvailableLocales()) {
      Map<String, String> optionMetadataEntries = new HashMap<String, String>();

      optionMetadataEntries.put("label", optionLabels.getValue(availableLocale));

      optionLabelsMap.put(availableLocale, optionMetadataEntries);
    }

    return optionLabelsMap;
  }
コード例 #2
0
  protected void addMetadataEntryValues(
      Map<Locale, Map<String, String>> ddmFormFieldMetadataMap,
      String entryName,
      LocalizedValue localizedValue) {

    for (Locale availableLocale : localizedValue.getAvailableLocales()) {
      Map<String, String> metadataMap = ddmFormFieldMetadataMap.get(availableLocale);

      if (metadataMap == null) {
        metadataMap = new HashMap<String, String>();

        ddmFormFieldMetadataMap.put(availableLocale, metadataMap);
      }

      metadataMap.put(entryName, localizedValue.getValue(availableLocale));
    }
  }