/** * Gets the form object from the context, using the specified name. * @param formObjectName the name of the form in the context * @param formObjectClass the class of the form object, which will be verified * @param scopeType the scope to obtain the form object from * @return the form object, or null if not found */ public Object getFormObject(String formObjectName, Class<?> formObjectClass, ScopeType scopeType) { return scopeType.getScope(context).get(formObjectName, formObjectClass); }
public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) throws BeansException { beanFactory.registerScope(ScopeType.REQUEST.name().toLowerCase(), new RequestScope()); beanFactory.registerScope(ScopeType.FLASH.name().toLowerCase(), new FlashScope()); beanFactory.registerScope(ScopeType.VIEW.name().toLowerCase(), new ViewScope()); beanFactory.registerScope(ScopeType.FLOW.name().toLowerCase(), new FlowScope()); beanFactory.registerScope(ScopeType.CONVERSATION.name().toLowerCase(), new ConversationScope()); }
@SuppressWarnings("deprecation") public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) throws BeansException { beanFactory.registerScope(ScopeType.FLASH.getLabel().toLowerCase(), new FlashScope()); beanFactory.registerScope(ScopeType.VIEW.getLabel().toLowerCase(), new ViewScope()); beanFactory.registerScope(ScopeType.FLOW.getLabel().toLowerCase(), new FlowScope()); beanFactory.registerScope(ScopeType.CONVERSATION.getLabel().toLowerCase(), new ConversationScope()); }
public boolean equals(Object o) { if (!(o instanceof FlowVariable)) { return false; } FlowVariable other = (FlowVariable) o; return name.equals(other.name) && scope.equals(other.scope); }
public int hashCode() { return name.hashCode() + scope.hashCode(); }
public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) throws BeansException { beanFactory.registerScope(ScopeType.REQUEST.getLabel().toLowerCase(), new RequestScope()); beanFactory.registerScope(ScopeType.FLASH.getLabel().toLowerCase(), new FlashScope()); beanFactory.registerScope(ScopeType.VIEW.getLabel().toLowerCase(), new ViewScope()); beanFactory.registerScope(ScopeType.FLOW.getLabel().toLowerCase(), new FlowScope()); beanFactory.registerScope(ScopeType.CONVERSATION.getLabel().toLowerCase(), new ConversationScope()); }
/** * Gets the form object from the context, using the specified name. * @param formObjectName the name of the form object in the context * @param scopeType the scope to obtain the form object from * @return the form object, or null if not found */ public Object getFormObject(String formObjectName, ScopeType scopeType) { return scopeType.getScope(context).get(formObjectName); }
public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) throws BeansException { beanFactory.registerScope(ScopeType.REQUEST.name().toLowerCase(), new RequestScope()); beanFactory.registerScope(ScopeType.FLASH.name().toLowerCase(), new FlashScope()); beanFactory.registerScope(ScopeType.VIEW.name().toLowerCase(), new ViewScope()); beanFactory.registerScope(ScopeType.FLOW.name().toLowerCase(), new FlowScope()); beanFactory.registerScope(ScopeType.CONVERSATION.name().toLowerCase(), new ConversationScope()); }
/** * Gets the form object <code>Errors</code> tracker from the context, using the specified form object name. * @param formObjectName the name of the Errors object, which will be prefixed with * {@link BindingResult#MODEL_KEY_PREFIX} * @param scopeType the scope to obtain the errors from * @return the form object errors instance, or null if not found */ public Errors getFormErrors(String formObjectName, ScopeType scopeType) { return scopeType.getScope(context).get(ERRORS_PREFIX + formObjectName, Errors.class); }
/** * Expose given form object using the well known alias in the specified scope. * @param formObject the form object * @param scopeType the scope in which to expose the form object */ public void setCurrentFormObject(Object formObject, ScopeType scopeType) { // don't call setFormObject since that would cause infinite recursion! scopeType.getScope(context).put(getCurrentFormObjectName(), formObject); }
/** * Expose given form object using given name in specified scope. Given object will become the <i>current</i> form * object. * @param formObject the form object * @param formObjectName the name of the form object * @param scopeType the scope in which to expose the form object */ public void putFormObject(Object formObject, String formObjectName, ScopeType scopeType) { scopeType.getScope(context).put(formObjectName, formObject); setCurrentFormObject(formObject, scopeType); }
/** * Expose given errors instance using the well known alias in the specified scope. * @param errors the errors instance * @param scopeType the scope in which to expose the errors instance */ public void setCurrentFormErrors(Errors errors, ScopeType scopeType) { scopeType.getScope(context).put(getCurrentFormErrorsName(), errors); }
/** * Expose given errors instance in the specified scope. Given errors instance will become the <i>current</i> form * errors instance. * @param errors the errors object * @param scopeType the scope to expose the errors in */ public void putFormErrors(Errors errors, ScopeType scopeType) { scopeType.getScope(context).put(ERRORS_PREFIX + errors.getObjectName(), errors); setCurrentFormErrors(errors, scopeType); } }
/** * Expose given bean method return value in given flow execution request context. * @param result the return value * @param context the request context */ public void exposeResult(Object result, RequestContext context) { resultScope.getScope(context).put(resultName, result); }
/** * Gets the form object from the context, using the specified name. * @param formObjectName the name of the form object in the context * @param scopeType the scope to obtain the form object from * @return the form object, or null if not found */ public Object getFormObject(String formObjectName, ScopeType scopeType) { return scopeType.getScope(context).get(formObjectName); }
/** * Gets the form object <code>Errors</code> tracker from the context, using the specified form object name. * @param formObjectName the name of the Errors object, which will be prefixed with * {@link BindException#ERROR_KEY_PREFIX} * @param scopeType the scope to obtain the errors from * @return the form object errors instance, or null if not found */ public Errors getFormErrors(String formObjectName, ScopeType scopeType) { return (Errors) scopeType.getScope(context).get(ERRORS_PREFIX + formObjectName, Errors.class); }
/** * Gets the form object from the context, using the specified name. * @param formObjectName the name of the form object in the context * @param scopeType the scope to obtain the form object from * @return the form object, or null if not found */ public Object getFormObject(String formObjectName, ScopeType scopeType) { return scopeType.getScope(context).get(formObjectName); }
/** * Gets the form object from the context, using the specified name. * @param formObjectName the name of the form in the context * @param formObjectClass the class of the form object, which will be verified * @param scopeType the scope to obtain the form object from * @return the form object, or null if not found */ public Object getFormObject(String formObjectName, Class<?> formObjectClass, ScopeType scopeType) { return scopeType.getScope(context).get(formObjectName, formObjectClass); }
/** * Gets the form object <code>Errors</code> tracker from the context, using the specified form object name. * @param formObjectName the name of the Errors object, which will be prefixed with * {@link BindingResult#MODEL_KEY_PREFIX} * @param scopeType the scope to obtain the errors from * @return the form object errors instance, or null if not found */ public Errors getFormErrors(String formObjectName, ScopeType scopeType) { return scopeType.getScope(context).get(ERRORS_PREFIX + formObjectName, Errors.class); }
/** * Gets the form object from the context, using the specified name. * @param formObjectName the name of the form in the context * @param formObjectClass the class of the form object, which will be verified * @param scopeType the scope to obtain the form object from * @return the form object, or null if not found */ public Object getFormObject(String formObjectName, Class formObjectClass, ScopeType scopeType) { return scopeType.getScope(context).get(formObjectName, formObjectClass); }