/** * {@inheritDoc} */ @Override protected void saveState(Anything a) { super.saveState(a); Vector<String> flatDictionary = new Vector<String>(); for (Map.Entry<String, String> dictEntry : dictionary.entrySet()) { flatDictionary.add(dictEntry.getKey()); flatDictionary.add(dictEntry.getValue()); } saveState(a, TranslationDataTypeConstants.DICTIONARY, flatDictionary, null); }
/** * Gets a (cached) translation data type. * * @param id * the id the translation data type is (or has been) stored with. * @param locale * the locale the translation data type uses. * @param translationMapping * key / value translation mapping used whenever the translation * datatype does not exist yet and must be created. * @return the corresponding translation data type. */ public ULCTranslationDataType getTranslationDataType(String id, Locale locale, Map<String, String> translationMapping) { Map<Locale, ULCTranslationDataType> idStore = dataTypeStore.get(id); if (idStore == null) { idStore = new HashMap<Locale, ULCTranslationDataType>(); dataTypeStore.put(id, idStore); } ULCTranslationDataType dataType = idStore.get(locale); if (dataType == null) { dataType = new ULCTranslationDataType(translationMapping); idStore.put(locale, dataType); } return dataType; } }
/** * Gets a (cached) translation data type. * * @param id * the id the translation data type is (or has been) stored with. * @param locale * the locale the translation data type uses. * @param translationMapping * key / value translation mapping used whenever the translation * datatype does not exist yet and must be created. * @return the corresponding translation data type. */ public ULCTranslationDataType getTranslationDataType(String id, Locale locale, Map<String, String> translationMapping) { Map<Locale, ULCTranslationDataType> idStore = dataTypeStore.get(id); if (idStore == null) { idStore = new HashMap<Locale, ULCTranslationDataType>(); dataTypeStore.put(id, idStore); } ULCTranslationDataType dataType = idStore.get(locale); if (dataType == null) { dataType = new ULCTranslationDataType(translationMapping); idStore.put(locale, dataType); } return dataType; } }
/** * {@inheritDoc} */ @Override protected void saveState(Anything a) { super.saveState(a); Vector<String> flatDictionary = new Vector<String>(); for (Map.Entry<String, String> dictEntry : dictionary.entrySet()) { flatDictionary.add(dictEntry.getKey()); flatDictionary.add(dictEntry.getValue()); } saveState(a, TranslationDataTypeConstants.DICTIONARY, flatDictionary, null); }