Package ch.qos.cal10n.util

Examples of ch.qos.cal10n.util.CAL10NResourceBundle


   */
  public <E extends Enum<?>> String getMessage(E key, Object... args)
      throws MessageConveyorException {

    String declararingClassName = key.getDeclaringClass().getName();
    CAL10NResourceBundle rb = cache.get(declararingClassName);
    if (rb == null || rb.hasChanged()) {
      rb = lookup(key);
      cache.put(declararingClassName, rb);
    }

    String keyAsStr = key.toString();
    String value = rb.getString(keyAsStr);
    if (value == null) {
      return "No key found for " + keyAsStr;
    } else {
      if (args == null || args.length == 0) {
        return value;
View Full Code Here


              + key.getClass().getName() + "]. See also "
              + Cal10nConstants.MISSING_BN_ANNOTATION_URL);
    }

    String charset = AnnotationExtractor.getCharset(declaringClass, locale);
    CAL10NResourceBundle rb = CAL10NResourceBundleFinder.getBundle(this
        .getClass().getClassLoader(), baseName, locale, charset);

    if (rb == null) {
      throw new MessageConveyorException("Failed to locate resource bundle ["
          + baseName + "] for locale [" + locale + "] for enum type ["
View Full Code Here

      throws MessageConveyorException {

    Class<? extends Enum<?>> declaringClass = key.getDeclaringClass();

    String declaringClassName = declaringClass.getName();
    CAL10NResourceBundle rb = cache.get(declaringClassName);
    if (rb == null || rb.hasChanged()) {
      rb = lookupResourceBundleByEnumClassAndLocale(declaringClass);
      cache.put(declaringClassName, rb);
    }

    String keyAsStr = key.toString();
    String value = rb.getString(keyAsStr);
    if (value == null) {
      return "No key found for " + keyAsStr;
    } else {
      if (args == null || args.length == 0) {
        return value;
View Full Code Here

    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);

    if (rb == null) {
      throw new MessageConveyorException(
          "Failed to locate resource bundle [" + baseName
View Full Code Here

   */
  public <E extends Enum<?>> String getMessage(E key, Object... args)
      throws MessageConveyorException {

    String declararingClassName = key.getDeclaringClass().getName();
    CAL10NResourceBundle rb = cache.get(declararingClassName);
    if (rb == null || rb.hasChanged()) {
      rb = lookup(key);
      cache.put(declararingClassName, rb);
    }

    String keyAsStr = key.toString();
    String value = rb.getString(keyAsStr);
    if (value == null) {
      return "No key found for " + keyAsStr;
    } else {
      if (args == null || args.length == 0) {
        return value;
View Full Code Here

    String charset = AnnotationExtractor.getCharset(declaringClass, 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);

    if (rb == null) {
      throw new MessageConveyorException(
          "Failed to locate resource bundle [" + baseName
View Full Code Here

TOP

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

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.