/** * * Converts the given String, specified as a static expression * string, to the given expected type. The conversion is cached. **/ Object convertStaticValueToExpectedType (String pValue, Class pExpectedType, Logger pLogger) throws ELException { // See if the value is already of the expected type if (pExpectedType == String.class || pExpectedType == Object.class) { return pValue; } // Find the cached value Map valueByString = getOrCreateExpectedTypeMap (pExpectedType); if (!mBypassCache && valueByString.containsKey (pValue)) { return valueByString.get (pValue); } else { // Convert from a String Object ret = Coercions.coerce (pValue, pExpectedType, pLogger); valueByString.put (pValue, ret); return ret; } }