protected String getTemplateTranslatedValue(String standardCacheKey, String property, TranslatedEntity entityType, String entityId, String localeCode, String localeCountryCode, String specificPropertyKey, String generalPropertyKey) { String cacheKey = getCacheKey(ResultType.TEMPLATE, entityType); StandardCacheItem translation = null; LocalePair override = null; for (TranslationOverrideStrategy strategy : strategies) { override = strategy.getLocaleBasedTemplateValue(cacheKey, property, entityType, entityId, localeCode, localeCountryCode, specificPropertyKey, generalPropertyKey); if(override != null) { translation = override.getSpecificItem(); if (!strategy.validateTemplateProcessing(standardCacheKey, cacheKey)) { return null; } break; } } if (override == null) { throw new IllegalStateException("Expected at least one TranslationOverrideStrategy to return a valid value"); } return translation==null?null:replaceEmptyWithNullResponse(((Translation) translation.getCacheItem()).getTranslatedValue()); }