Package java.util

Examples of java.util.ResourceBundle.containsKey()


        private String getMessage(final LogRecord record) {
            final ResourceBundle bundle = record.getResourceBundle();
            final Object[] params = record.getParameters();
            final String message;
            if (bundle != null && bundle.containsKey(record.getMessage())) {
                // todo: cannot enforce Locale.ENGLISH here
                message = bundle.getString(record.getMessage());
            } else {
                message = record.getMessage();
            }
View Full Code Here


    static String getMessageId(LogRecord lr) {
        String msg = lr.getMessage();
        if (msg != null && !msg.isEmpty()) {
          ResourceBundle rb = lr.getResourceBundle();
          if (rb != null) {       
            if (rb.containsKey(msg)) {
              String msgBody = lr.getResourceBundle().getString(msg);
              if (!msgBody.isEmpty()) {
                return msg;
              }
            }
View Full Code Here

            } 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

                    JMeterUtils.getLocale());

            // Store the resource bundle as an attribute of the BeanDescriptor:
            getBeanDescriptor().setValue(RESOURCE_BUNDLE, resourceBundle);
            // Localize the bean name
            if (resourceBundle.containsKey("displayName")) { // $NON-NLS-1$
                getBeanDescriptor().setDisplayName(resourceBundle.getString("displayName")); // $NON-NLS-1$
            } else {
                log.debug("Localized display name not available for bean " + beanClass);                   
            }
            // Localize the property names and descriptions:
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

    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

  }

  protected String getBundlePattern( final Method method ) {
    String pattern = null;
    ResourceBundle bundle = findBundle();
    if( bundle != null && bundle.containsKey( method.getName() ) ) {
      pattern = bundle.getString( method.getName() );
    }
    return pattern;
  }
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

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.