1 16 package org.springframework.webflow.action; 17 18 import java.io.Serializable ; 19 20 import org.springframework.core.style.ToStringCreator; 21 import org.springframework.util.Assert; 22 import org.springframework.webflow.execution.RequestContext; 23 import org.springframework.webflow.execution.ScopeType; 24 25 34 public class ActionResultExposer implements Serializable { 35 36 39 private String resultName; 40 41 44 private ScopeType resultScope; 45 46 51 public ActionResultExposer(String resultName, ScopeType resultScope) { 52 Assert.notNull(resultName, "The result name is required"); 53 Assert.notNull(resultScope, "The result scope is required"); 54 this.resultName = resultName; 55 this.resultScope = resultScope; 56 } 57 58 61 public String getResultName() { 62 return resultName; 63 } 64 65 68 public ScopeType getResultScope() { 69 return resultScope; 70 } 71 72 78 public void exposeResult(Object result, RequestContext context) { 79 resultScope.getScope(context).put(resultName, result); 80 } 81 82 public String toString() { 83 return new ToStringCreator(this).append("resultName", resultName).append("resultScope", resultScope).toString(); 84 } 85 } | Popular Tags |