classes = map.get(FacesConverter.class);
if (classes != null && !classes.isEmpty())
{
for (Class<?> clazz : classes)
{
FacesConverter conv = (FacesConverter) clazz
.getAnnotation(FacesConverter.class);
if (conv != null)
{
if (log.isLoggable(Level.FINEST))
{
log.finest("addConverter(" + conv.value() + ","
+ clazz.getName() + ")");
}
//If there is a previous entry on Application Configuration Resources,
//the entry there takes precedence
if (!Object.class.equals(conv.forClass()))
{
Converter converter = new Converter();
converter.setForClass(conv.forClass().getName());
converter.setConverterClass(clazz.getName());
facesConfig.addConverter(converter);
}
else
{
Converter converter = new Converter();
converter.setConverterId(conv.value());
converter.setConverterClass(clazz.getName());
facesConfig.addConverter(converter);
}
}
}