* @param value typed value to be converted
* @param state expression state
* @return {@code TypedValue} instance converted to {@code String}
*/
private static String convertTypedValueToString(TypedValue value, ExpressionState state) {
TypeConverter typeConverter = state.getEvaluationContext().getTypeConverter();
TypeDescriptor typeDescriptor = TypeDescriptor.valueOf(String.class);
if (typeConverter.canConvert(value.getTypeDescriptor(), typeDescriptor)) {
return String.valueOf(typeConverter.convertValue(value.getValue(),
value.getTypeDescriptor(), typeDescriptor));
}
return String.valueOf(value.getValue());
}