Package java.util

Examples of java.util.ResourceBundle.containsKey()


                    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


    @SuppressWarnings("unchecked")
    static <T> T getLocalizedResource(String key, Locale locale) {
        LocaleResources lr = LocaleProviderAdapter.getResourceBundleBased()
                                    .getLocaleResources(locale);
        ResourceBundle rb = lr.getJavaTimeFormatData();
        return rb.containsKey(key) ? (T) rb.getObject(key) : null;
    }

    /**
     * Stores the text for a single locale.
     * <p>
 
View Full Code Here

            Objects.requireNonNull(locale, "locale");
            if (rangeUnit == YEARS) {  // only have values for week-of-year
                LocaleResources lr = LocaleProviderAdapter.getResourceBundleBased()
                        .getLocaleResources(locale);
                ResourceBundle rb = lr.getJavaTimeFormatData();
                return rb.containsKey("field.week") ? rb.getString("field.week") : name;
            }
            return name;
        }

        @Override
View Full Code Here

        ResourceBundle resource = ((ResourceBundleBasedAdapter)adapter).getLocaleData().getDateFormatData(locale);

        // JRE and CLDR use different keys
        // JRE: Eras, short.Eras and narrow.Eras
        // CLDR: long.Eras, Eras and narrow.Eras
        if (resource.containsKey("Eras")) {
            eras = resource.getStringArray("Eras");
        } else if (resource.containsKey("long.Eras")) {
            eras = resource.getStringArray("long.Eras");
        } else if (resource.containsKey("short.Eras")) {
            eras = resource.getStringArray("short.Eras");
View Full Code Here

        // JRE and CLDR use different keys
        // JRE: Eras, short.Eras and narrow.Eras
        // CLDR: long.Eras, Eras and narrow.Eras
        if (resource.containsKey("Eras")) {
            eras = resource.getStringArray("Eras");
        } else if (resource.containsKey("long.Eras")) {
            eras = resource.getStringArray("long.Eras");
        } else if (resource.containsKey("short.Eras")) {
            eras = resource.getStringArray("short.Eras");
        }
        months = resource.getStringArray("MonthNames");
View Full Code Here

        // CLDR: long.Eras, Eras and narrow.Eras
        if (resource.containsKey("Eras")) {
            eras = resource.getStringArray("Eras");
        } else if (resource.containsKey("long.Eras")) {
            eras = resource.getStringArray("long.Eras");
        } else if (resource.containsKey("short.Eras")) {
            eras = resource.getStringArray("short.Eras");
        }
        months = resource.getStringArray("MonthNames");
        shortMonths = resource.getStringArray("MonthAbbreviations");
        ampms = resource.getStringArray("AmPmMarkers");
View Full Code Here

        locale = Locale.US;
      }
         
      ResourceBundle resourceBundle = ResourceBundle.getBundle(bundle, locale);
      if (resourceBundle!=null) {
        if (resourceBundle.containsKey(key)) {
          returnString = resourceBundle.getString(key);
        } else {
          throw new Exception(ResourceBundle.getBundle("ErrorMessageStringResource").getString("Error.i18nNow.Key.NotExist"));
        }
      } else {
View Full Code Here

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

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.