}
private <E extends Enum<?>> CAL10NResourceBundle lookupResourceBundleByEnumClassAndLocale(Class<E> declaringClass)
throws MessageConveyorException {
AnnotationExtractor annotationExtractor = new AnnotationExtractor(declaringClass);
// basename is declared via an annotation on the declaringClass
String baseName = annotationExtractor.getBaseName();
if (baseName == null) {
throw new MessageConveyorException(
"Missing @BaseName annotation in enum type ["
+ declaringClass.getName() + "]. See also "
+ CAL10NConstants.MISSING_BN_ANNOTATION_URL);
}
String charset = annotationExtractor.extractCharset(locale);
// use the declaring class' loader instead of
// this.getClass().getClassLoader()
// see also http://jira.qos.ch/browse/CAL-8
CAL10NResourceBundle rb = CAL10NResourceBundleFinder.getBundle(
declaringClass.getClassLoader(), baseName, locale, charset);