Package java.util

Examples of java.util.ResourceBundle.containsKey()


            } else {
                bundle = getBundle(loggerName, locale, true);
            }
        }
        final String messagePattern = getFormat();
        final String msgPattern = (bundle == null || !bundle.containsKey(messagePattern)) ?
            messagePattern : bundle.getString(messagePattern);
        final Object[] array = argArray == null ? stringArgs : argArray;
        final FormattedMessage msg = new FormattedMessage(msgPattern, array);
        formattedMessage = msg.getFormattedMessage();
        throwable = msg.getThrowable();
View Full Code Here


  {
    try
    {
      final ResourceBundle bundle = getBundle(Locale.getDefault());
      final String key = "parameter." + position + ".editor";
      if (bundle.containsKey(key) == false)
      {
        return null;
      }
      final String string = bundle.getString(key);
      return ObjectUtilities.loadAndInstantiate(string, AbstractSequenceDescription.class, PropertyEditor.class);
View Full Code Here

      loadMsgs();
    }

    if (localMessages.containsKey(language)) {
      ResourceBundle languageLocal = localMessages.get(language);
      if (languageLocal.containsKey(key)) {
        return languageLocal.getString(key);
      }
      String lowKey = key.toLowerCase();
      if (languageLocal.containsKey(lowKey)) {
        return languageLocal.getString(lowKey);
View Full Code Here

      ResourceBundle languageLocal = localMessages.get(language);
      if (languageLocal.containsKey(key)) {
        return languageLocal.getString(key);
      }
      String lowKey = key.toLowerCase();
      if (languageLocal.containsKey(lowKey)) {
        return languageLocal.getString(lowKey);
      }
    }
    try {
View Full Code Here

        int numBundles = messagesBundles_.size();
        int ct = 0;
        while (!found && ct < numBundles)
        {
            ResourceBundle bundle = messagesBundles_.get(ct++);
            if (bundle.containsKey(key))  {
                label = bundle.getString(key);
                if (params != null) {
                    MessageFormat formatter = new MessageFormat(label, currentLocale_.getLocale());
                    label = formatter.format(params);
                }
View Full Code Here

    catch (MissingResourceException e) {
      // ErraiService is optional!
      return;
    }

    if (erraiServiceConfig.containsKey(ERRAI_CDI_STANDALONE)) {
      final boolean standalone = "true".equals(erraiServiceConfig.getString(ERRAI_CDI_STANDALONE).trim());

      if (standalone) {
        log.info("errai cdi running in standalone mode.");
      }
View Full Code Here

        log.info("errai cdi running as regular extension.");
      }
    }

    final String dispatchImplKey = "errai.dispatcher_implementation";
    if (erraiServiceConfig.containsKey(dispatchImplKey)) {
      if (AsyncDispatcher.class.getName().equals(erraiServiceConfig.getString(dispatchImplKey))) {
        throw new ErraiBootstrapFailure("Cannot start Errai CDI. You have have configured the service to use the " +
            AsyncDispatcher.class.getName()
            + " dispatcher implementation. Due to limitations of Weld, you must use the " +
            SimpleDispatcher.class.getName() + " in order to use this module.");
View Full Code Here

        ResourceBundle b = (ResourceBundle) beanInfo.getBeanDescriptor().getValue(RESOURCE_BUNDLE);
        if (b == null) {
            return group;
        }
        String key = new StringBuilder(group).append(".displayName").toString();
        if (b.containsKey(key)) {
            return b.getString(key);
        } else {
            return group;
        }
    }
View Full Code Here

        try {
            ResourceBundle bundle = resources;
            if(forcedLocale != null) {
                bundle = ResourceBundle.getBundle("org.apache.jmeter.resources.messages", forcedLocale); // $NON-NLS-1$
            }
            if (bundle.containsKey(resKey)) {
                resString = bundle.getString(resKey);
            } else {
                log.warn("ERROR! Resource string not found: [" + resKey + "]");
                resString = defaultValue;               
            }
View Full Code Here

      return null;
    }   
   
    ResourceBundle langRB = loadTranslation(componentClass);
   
    if (langRB != null && langRB.containsKey(LOCALIZED_NAME_ENTRY)) {
      return langRB.getString(LOCALIZED_NAME_ENTRY);
    } else {
      return null;
    }
 
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.