Package java.util

Examples of java.util.ResourceBundle.containsKey()


            // Store the resource bundle as an attribute of the BeanDescriptor:
            getBeanDescriptor().setValue(RESOURCE_BUNDLE, resourceBundle);
            final String dnKey = "displayName";
            // Localize the bean name
            if (resourceBundle.containsKey(dnKey)) { // $NON-NLS-1$
                getBeanDescriptor().setDisplayName(resourceBundle.getString(dnKey)); // $NON-NLS-1$
            } else {
                log.debug("Localized display name not available for bean " + beanClass);                   
            }
            // Localize the property names and descriptions:
View Full Code Here


            // Localize the property names and descriptions:
            PropertyDescriptor[] properties = getPropertyDescriptors();
            for (PropertyDescriptor property : properties) {
                String name = property.getName();
                final String propDnKey = name + ".displayName";
                if(resourceBundle.containsKey(propDnKey)) {
                    property.setDisplayName(resourceBundle.getString(propDnKey)); // $NON-NLS-1$
                } else {
                    log.debug("Localized display name not available for property " + name + " in " + beanClass);
                }
                final String propSdKey = name + ".shortDescription";
View Full Code Here

                    property.setDisplayName(resourceBundle.getString(propDnKey)); // $NON-NLS-1$
                } else {
                    log.debug("Localized display name not available for property " + name + " in " + beanClass);
                }
                final String propSdKey = name + ".shortDescription";
                if(resourceBundle.containsKey(propSdKey)) {
                    property.setShortDescription(resourceBundle.getString(propSdKey));
                } else {
                    log.debug("Localized short description not available for property " + name + " in " + beanClass);
                }
            }
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

        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

            for (String key : keyList) {
                String tempKey = key.replaceAll("@@", "");
                String label = null;

                if (bundle != null && bundle.containsKey(tempKey)) {
                    label = bundle.getString(tempKey);
                } else if (ResourceBundleUtil.getMessage(tempKey) != null) {
                    label = ResourceBundleUtil.getMessage(tempKey);
                }
View Full Code Here

    this.managedTypes = new TypeRegistry();

    try {
      log.info("starting errai cdi ...");
      ResourceBundle erraiServiceConfig = getBundle("ErraiService");
      if (erraiServiceConfig.containsKey(ERRAI_CDI_STANDALONE)) {
        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

                bundle = getBundle(bundleId, locale, false);
            } else {
                bundle = getBundle(loggerName, locale, true);
            }
        }
        String msgPattern = (bundle == null || !bundle.containsKey(messagePattern)) ?
            messagePattern : bundle.getString(messagePattern);
        return format(msgPattern, args);
    }

    /**
 
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

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.