private Object getRealValue(Map context, Object value, Class convertToClass) { if (value == null || convertToClass == null) { return value; } return xworkConverter.convertValue(context, value, convertToClass); } }
private Object getRealValue(Map context, Object value, Class convertToClass) { if (value == null || convertToClass == null) { return value; } return xworkConverter.convertValue(context, value, convertToClass); } }
@Override public Object convertValue(Map<String, Object> map, Object o, Class aClass) { return convertValue(map, null, null, null, o, aClass); }
private Object getValue(Map context, Object value) { Class lastClass = (Class) context.get(XWorkConverter.LAST_BEAN_CLASS_ACCESSED); String lastProperty = (String) context.get(XWorkConverter.LAST_BEAN_PROPERTY_ACCESSED); if (lastClass == null || lastProperty == null) { return value; } Class elementClass = objectTypeDeterminer.getElementClass(lastClass, lastProperty, null); if (elementClass == null) { return value; // nothing is specified, we assume it will be the value passed in. } return xworkConverter.convertValue(context, value, elementClass); }
private Object getKey(Map context, Object name) { Class lastClass = (Class) context.get(XWorkConverter.LAST_BEAN_CLASS_ACCESSED); String lastProperty = (String) context.get(XWorkConverter.LAST_BEAN_PROPERTY_ACCESSED); if (lastClass == null || lastProperty == null) { // return java.lang.String.class; // commented out the above -- it makes absolutely no sense for when setting basic maps! return name; } Class keyClass = objectTypeDeterminer.getKeyClass(lastClass, lastProperty); if (keyClass == null) { keyClass = java.lang.String.class; } return xworkConverter.convertValue(context, name, keyClass); } }
private Object tryFindValue(String expr, Class asType) throws OgnlException { Object value = null; try { expr = lookupForOverrides(expr); value = getValue(expr, asType); if (value == null) { value = findInContext(expr); return converter.convertValue(getContext(), value, asType); } } finally { context.remove(THROW_EXCEPTION_ON_FAILURE); } return value; }
/** * @see com.opensymphony.xwork2.util.ValueStack#findValue(java.lang.String, java.lang.Class) */ public Object findValue(String expr, Class asType, boolean throwExceptionOnFailure) { try { setupExceptionOnFailure(throwExceptionOnFailure); return tryFindValueWhenExpressionIsNotNull(expr, asType); } catch (OgnlException e) { final Object value = handleOgnlException(expr, throwExceptionOnFailure, e); return converter.convertValue(getContext(), value, asType); } catch (Exception e) { final Object value = handleOtherException(expr, throwExceptionOnFailure, e); return converter.convertValue(getContext(), value, asType); } finally { ReflectionContextState.clear(context); } }
String stringElement = (String)conv.convertValue(context, element, String.class); if (shallBeIncluded(stringElement, excludeEmptyElements)) { if (evaluator != null) {
Object realKey = xworkConverter.convertValue(context, key, keyType); Object value = collMap.get(realKey); if (value == null Object realKey = xworkConverter.convertValue(context, key, keyType); return getPropertyThroughIteration(context, c, keyProperty, realKey);