public static boolean isCreatingNullObjects(Map<String, Object> context) { //TODO return getBooleanProperty(ReflectionContextState.CREATE_NULL_OBJECTS, context); }
public static void setCreatingNullObjects(Map<String, Object> context, boolean creatingNullObjects) { setBooleanValue(ReflectionContextState.CREATE_NULL_OBJECTS, context, creatingNullObjects); }
private void cleanUpContext(Map<String, Object> context) { ReflectionContextState.clear(context); context.remove(XWorkConverter.CONVERSION_PROPERTY_FULLNAME); context.remove(REPORT_ERRORS_ON_NO_PROP); }
public Validator buildValidator(String className, Map<String, Object> params, Map<String, Object> extraContext) throws Exception { Validator validator = (Validator) objectFactory.buildBean(className, extraContext); reflectionProvider.setProperties(params, validator, extraContext); return validator; } }
/** * Sets up the context with the last property and last class * accessed. * * @param context * @param proxy */ private void setupContext(Map context, ObjectProxy proxy) { ReflectionContextState.setLastBeanClassAccessed(context, proxy.getLastClassAccessed()); ReflectionContextState.setLastBeanPropertyAccessed(context, proxy.getLastPropertyAccessed()); } }
public Object getValue(String expression, Map<String, Object> context, Object root) throws ReflectionException { try { return ognlUtil.getValue(expression, context, root); } catch (OgnlException e) { throw new ReflectionException(e); } }
/** * Retrieves an annotation for the specified field of setter. * * @param parentClass the Class which contains as a property the Map or Collection we are finding the key for. * @param property the property of the Map or Collection for the given parent class * @param annotationClass The annotation * @return concrete Annotation instance or <tt>null</tt> if none could be retrieved. */ private <T extends Annotation> T getAnnotationFromSetter(Class parentClass, String property, Class<T> annotationClass) { try { Method setter = reflectionProvider.getSetMethod(parentClass, property); if (setter != null) { return setter.getAnnotation(annotationClass); } } catch (ReflectionException ognle) { // ignore } catch (IntrospectionException ie) { // ignore } return null; }
public Method getGetMethod(Class targetClass, String propertyName) throws IntrospectionException, ReflectionException { try { return OgnlRuntime.getGetMethod(null, targetClass, propertyName); } catch (OgnlException e) { throw new ReflectionException(e); } }
public static boolean isReportingConversionErrors(Map<String, Object> context) { return getBooleanProperty(XWorkConverter.REPORT_CONVERSION_ERRORS, context); }
public static void setDenyMethodExecution(Map<String, Object> context, boolean denyMethodExecution) { setBooleanValue(ReflectionContextState.DENY_METHOD_EXECUTION, context, denyMethodExecution); }
/** * @see com.opensymphony.xwork2.util.ValueStack#findValue(java.lang.String) */ public Object findValue(String expr, boolean throwExceptionOnFailure) { try { setupExceptionOnFailure(throwExceptionOnFailure); return tryFindValueWhenExpressionIsNotNull(expr); } catch (OgnlException e) { return handleOgnlException(expr, throwExceptionOnFailure, e); } catch (Exception e) { return handleOtherException(expr, throwExceptionOnFailure, e); } finally { ReflectionContextState.clear(context); } }
public Object getRealTarget(String property, Map<String, Object> context, Object root) throws ReflectionException { try { return ognlUtil.getRealTarget(property, context, root); } catch (OgnlException e) { throw new ReflectionException(e); } }
public static boolean isDenyMethodExecution(Map<String, Object> context) { return getBooleanProperty(ReflectionContextState.DENY_METHOD_EXECUTION, context); }
public static void setReportingConversionErrors(Map<String, Object> context, boolean reportingErrors) { setBooleanValue(XWorkConverter.REPORT_CONVERSION_ERRORS, context, reportingErrors); }
public PropertyDescriptor getPropertyDescriptor(Class targetClass, String propertyName) throws IntrospectionException, ReflectionException { try { return OgnlRuntime.getPropertyDescriptor(targetClass, propertyName); } catch (OgnlException e) { throw new ReflectionException(e); } }
public static boolean isGettingByKeyProperty(Map<String, Object> context) { return getBooleanProperty(GETTING_BY_KEY_PROPERTY, context); }
public static void setGettingByKeyProperty(Map<String, Object> context, boolean gettingByKeyProperty) { setBooleanValue(GETTING_BY_KEY_PROPERTY, context, gettingByKeyProperty); }
public Method getSetMethod(Class targetClass, String propertyName) throws IntrospectionException, ReflectionException { try { return OgnlRuntime.getSetMethod(null, targetClass, propertyName); } catch (OgnlException e) { throw new ReflectionException(e); } }
public Map getBeanMap(Object source) throws IntrospectionException, ReflectionException { try { return ognlUtil.getBeanMap(source); } catch (OgnlException e) { throw new ReflectionException(e); } }
public void setValue(String expression, Map<String, Object> context, Object root, Object value) throws ReflectionException { try { Ognl.setValue(expression, context, root, value); } catch (OgnlException e) { throw new ReflectionException(e); } }