Package ch.qos.cal10n.util

Examples of ch.qos.cal10n.util.AnnotationExtractor


public class MessageKeyVerifier extends MessageKeyVerifierBase {

  final Class<? extends Enum<?>> enumClass;

  public MessageKeyVerifier(Class<? extends Enum<?>> enumClass) {
    super(enumClass.getName()new AnnotationExtractor(enumClass));
    this.enumClass = enumClass;
  }
View Full Code Here


  }

  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);
View Full Code Here

TOP

Related Classes of ch.qos.cal10n.util.AnnotationExtractor

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.