public class LanguageDiscriminator implements Discriminator {
private static final Log log = LogFactory.getLog(LanguageDiscriminator.class);
@Override
public String getAnalyzerDefinitionName(
Object value,
Object entity,
String field) {
CountrySite cs = (CountrySite) value;
if(cs != null)
return cs.getCountry().getDefaultLanguage().getLanguageCode();
log.warn("LanguageDiscriminator: No countrySite found, using Portugese ");
return "pt";
}
}