public Object evaluate( VariableResolver vResolver ) throws ELException { return evaluator.evaluate(this.expression, this.expectedType, vResolver, this.fMapper); } }
Object parsedValue = parseExpressionString (pExpressionString); return convertStaticValueToExpectedType (strValue, pExpectedType, pLogger); functions, pLogger); return convertToExpectedType (value, pExpectedType, pLogger); functions, pLogger); return convertToExpectedType (strValue, pExpectedType, pLogger);
/** * * 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; } }
(formatParseException (pExpressionString, exc));
break; encounteredBuf.append (addEscapes (tok.image)); tok = tok.next;
Object parsedValue = parseExpressionString (pExpressionString); return convertStaticValueToExpectedType (strValue, pExpectedType, pLogger); functions, pLogger); return convertToExpectedType (value, pExpectedType, pLogger); functions, pLogger); return convertToExpectedType (strValue, pExpectedType, pLogger);
/** * * 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; } }
(formatParseException (pExpressionString, exc));
break; encounteredBuf.append (addEscapes (tok.image)); tok = tok.next;
public Object evaluate( VariableResolver vResolver ) throws ELException { return evaluator.evaluate(this.expression, this.expectedType, vResolver, this.fMapper); } }
/** * * Parses the given expression string, then converts it back to a * String in its canonical form. This is used to test parsing. **/ public String parseAndRender (String pExpressionString) throws ELException { Object val = parseExpressionString (pExpressionString); if (val instanceof String) { return (String) val; } else if (val instanceof Expression) { return "${" + ((Expression) val).getExpressionString () + "}"; } else if (val instanceof ExpressionString) { return ((ExpressionString) val).getExpressionString (); } else { return ""; } }
/** * * Evaluates the given expression String * * @param pExpressionString The expression to be evaluated. * @param pExpectedType The expected type of the result of the evaluation * @param pResolver A VariableResolver instance that can be used at * runtime to resolve the name of implicit objects into Objects. * @param functions A FunctionMapper to resolve functions found in * the expression. It can be null, in which case no functions * are supported for this invocation. * @return the expression String evaluated to the given expected * type **/ public Object evaluate (String pExpressionString, Class pExpectedType, VariableResolver pResolver, FunctionMapper functions) throws ELException { return evaluate (pExpressionString, pExpectedType, pResolver, functions, sLogger); }
/** * * Parses the given expression string, then converts it back to a * String in its canonical form. This is used to test parsing. **/ public String parseAndRender (String pExpressionString) throws ELException { Object val = parseExpressionString (pExpressionString); if (val instanceof String) { return (String) val; } else if (val instanceof Expression) { return "${" + ((Expression) val).getExpressionString () + "}"; } else if (val instanceof ExpressionString) { return ((ExpressionString) val).getExpressionString (); } else { return ""; } }
/** * * Evaluates the given expression String * * @param pExpressionString The expression to be evaluated. * @param pExpectedType The expected type of the result of the evaluation * @param pResolver A VariableResolver instance that can be used at * runtime to resolve the name of implicit objects into Objects. * @param functions A FunctionMapper to resolve functions found in * the expression. It can be null, in which case no functions * are supported for this invocation. * @return the expression String evaluated to the given expected * type **/ public Object evaluate (String pExpressionString, Class pExpectedType, VariableResolver pResolver, FunctionMapper functions) throws ELException { return evaluate (pExpressionString, pExpectedType, pResolver, functions, sLogger); }