Retrieve a date from bundle.

@param key the key of resource

@return the resource date

@throws MissingResourceException if the requested key is unknown
974241
public Date getDate( String key )
        throws MissingResourceException
    {
        ResourceBundle bundle = getBundle();
        String value = bundle.getString( key );
        try
        {
            DateFormat format =
                DateFormat.getDateInstance( DateFormat.DEFAULT, m_locale );
            return format.parse( value );
        }
        catch( ParseException pe )
        {
            throw new MissingResourceException( "Expecting a date value but got " + value,
                                                "java.lang.String",
                                                key
            );
        }
    }
869879
public static Date getEventDate(Key key)
    {
        Key ek = findAncestor(Repository.EVENT, key);
        return new Date(ek.getId());
    }
957226
private Object handleGetObjectImpl(String aKey, UResourceBundle requested) {
        Object obj = resolveObject(aKey, requested);
        if (obj == null) {
            UResourceBundle parentBundle = getParent();
            if (parentBundle != null) {
                obj = parentBundle.handleGetObjectImpl(aKey, requested);
            }
            if (obj == null)
                throw new MissingResourceException(
                    "Can't find resource for bundle "
                    + this.getClass().getName() + ", key " + aKey,
                    this.getClass().getName(), aKey);
        }
        return obj;
    }
1301838
public static Object getExtraObject(Activity context, String key) {
        Object param = null;
        Bundle bundle = context.getIntent().getExtras();
        if (bundle != null) {
            param = bundle.get(key);
        }
        return param;
    }
1179697
@Override
	public InputStream getResourceBundleAsStream(String bundleName) throws ResourceNotFoundException {

		InputStream is = context.getResourceAsStream(bundleName);
		if (is == null) {
			throw new ResourceNotFoundException(bundleName);
		}

		return is;
	}
216324
@Override
	public Reader getResource(JoinableResourceBundle bundle, String resourceName, boolean processingBundle)
			throws ResourceNotFoundException {

		return getResource(bundle, resourceName, processingBundle, new ArrayList<Class<?>>());
	}
1058865
public double getDouble( String key )
        throws MissingResourceException
    {
        ResourceBundle bundle = getBundle();
        String value = bundle.getString( key );
        try
        {
            return Double.parseDouble( value );
        }
        catch( NumberFormatException nfe )
        {
            throw new MissingResourceException( "Expecting a double value but got " + value,
                                                "java.lang.String",
                                                key
            );
        }
    }
707957
public Content getResource(String key) {
        Content c = newContent();
        c.addContent(getText(key));
        return c;
    }
402311
public static String getText(String key, ResourceBundle bundle)
    {
        try
        {
            return  bundle.getString(key);
        }
        catch (MissingResourceException ex)
        {
            return key;
        }
    }
564235
private String getResourceText(String key) {
        String text = null;
        if (key != null) {
            ResourceBundle bundle = null;

            // retrieve the resource bundle
            try {
                bundle = ResourceBundle.getBundle(DIST_EX_RESOURCE_BUNDLE_NAME);
            } catch (MissingResourceException e) {
                // do nothing
            }

            // if the resource bundle was successfully retrieved, get the specific text based
            // on the resource key
            if (bundle != null) {
                try {
                    text = bundle.getString(key);
                } catch (MissingResourceException e) {
                    // do nothing
                }
            }
        } else { // no key was provided
            // do nothing
        }
        return text;
    }
625303
public String getStringWithFallback(String path) throws MissingResourceException {
        // Optimized form of getWithFallback(path).getString();
        ICUResourceBundle actualBundle = this;
        String result = findStringWithFallback(path, actualBundle, null);

        if (result == null) {
            throw new MissingResourceException(
                "Can't find resource for bundle "
                + this.getClass().getName() + ", key " + getType(),
                path, getKey());
        }

        if (result.equals(NO_INHERITANCE_MARKER)) {
            throw new MissingResourceException("Encountered NO_INHERITANCE_MARKER", path, getKey());
        }
        return result;
    }
655948
public static @Nonnull JSONObject getBundle(@Nonnull String baseName) throws MissingResourceException {
        return getBundle(baseName, Locale.getDefault());
    }
864512
public static Date getDate(CSProperties p, String key) throws ParseException {
        String val = p.get(key).toString();
        if (val == null) {
            throw new IllegalArgumentException(key);
        }
        String f = p.getInfo(key).get(KEY_FORMAT);
        DateFormat fmt = new SimpleDateFormat(f == null ? ISO8601 : f);
        return fmt.parse(val);
    }
207784
@Override
	public Reader getResource(JoinableResourceBundle bundle, String resourceName) throws ResourceNotFoundException {

		return getResource(bundle, resourceName, false);
	}
1204940
private Resource mightCache(String key, Resource fileResource) {
        if ( ! isDevMode() ) {
            lookupCache.put(key,fileResource);
        }
        return fileResource;
    }
452589
@Override
   protected URL findResource(String name) {
      if (resourceCache.containsKey(name)) {
         return resourceCache.get(name);
      }

      for (WeakReference<Bundle> ref : bundles) {
         final Bundle bundle = ref.get();
         if (bundle != null && bundle.getState() == Bundle.ACTIVE) {
            try {
               final URL resource = bundle.getResource(name);
               if (resource != null) {
                  resourceCache.put(name, resource);
                  return resource;
               }
            } catch (Exception ignore) {
            }
         }
      }

      // TODO: Error?
      return null;
   }
1304748
public static String getText(String key, ResourceBundle bundle, Object... arguments)
	{
		try
		{
			String value = bundle.getString(key);

			return MessageFormat.format(value, arguments);
		}
		catch (MissingResourceException ex)
		{
			return key;
		}
	}