343536373839404142
public WhitelistTypeLocator() { } public Class<?> findType(String typeName) throws EvaluationException { if (notInWhitelist(typeName)) { throw new EvaluationException("Forbidden type: " + typeName); } return standardTypeLocator.findType(typeName); }
77787980818283
return TypeDescriptor.valueOf(String.class); } @Override public void setValue(EvaluationContext context, Object value) throws EvaluationException { throw new EvaluationException(this.literalValue, "Cannot call setValue() on a LiteralExpression"); }
146147148149150151152
return false; } @Override public void setValue(EvaluationContext context, Object rootObject, Object value) throws EvaluationException { throw new EvaluationException(this.literalValue, "Cannot call setValue() on a LiteralExpression"); }
156157158159160161162
return false; } @Override public void setValue(Object rootObject, Object value) throws EvaluationException { throw new EvaluationException(this.literalValue, "Cannot call setValue() on a LiteralExpression"); }
71727374757677
value, typedValue.getTypeDescriptor(), TypeDescriptor.valueOf(targetType)); } if (ClassUtils.isAssignableValue(targetType, value)) { return (T) value; } throw new EvaluationException("Cannot convert value '" + value + "' to type '" + targetType.getName() + "'"); }
126127128129130131132
return TypeDescriptor.valueOf(String.class); } @Override public void setValue(EvaluationContext context, Object value) throws EvaluationException { throw new EvaluationException(this.expressionString, "Cannot call setValue on a composite expression"); }
191192193194195196197
return false; } @Override public void setValue(EvaluationContext context, Object rootObject, Object value) throws EvaluationException { throw new EvaluationException(this.expressionString, "Cannot call setValue on a composite expression"); }
201202203204205206207
return false; } @Override public void setValue(Object rootObject, Object value) throws EvaluationException { throw new EvaluationException(this.expressionString, "Cannot call setValue on a composite expression"); }
65666768697071
return (T) value; } if (context != null) { return (T) context.getTypeConverter().convertValue(value, typedValue.getTypeDescriptor(), TypeDescriptor.valueOf(targetType)); } throw new EvaluationException("Cannot convert value '" + value + "' to type '" + targetType.getName() + "'"); }
64656667686970