}
private <E extends Enum<?>> CAL10NBundle lookupResourceBundleByEnumClassAndLocale(Class<E> declaringClass)
throws MessageConveyorException {
AnnotationExtractorViaEnumClass annotationExtractor = new AnnotationExtractorViaEnumClass(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
CAL10NBundleFinderByClassloader cal10NBundleFinderByClassloader = new CAL10NBundleFinderByClassloader(declaringClass.getClassLoader());
CAL10NBundle rb = cal10NBundleFinderByClassloader.getBundle(