1 16 package org.springframework.webflow.config; 17 18 import java.io.Serializable ; 19 20 import org.springframework.core.style.ToStringCreator; 21 import org.springframework.webflow.core.collection.LocalAttributeMap; 22 import org.springframework.webflow.core.collection.MutableAttributeMap; 23 import org.springframework.webflow.engine.support.ApplicationViewSelector; 24 25 32 public class FlowSystemDefaults implements Serializable { 33 34 37 private boolean alwaysRedirectOnPause = true; 38 39 42 private RepositoryType repositoryType = RepositoryType.CONTINUATION; 43 44 50 public void setAlwaysRedirectOnPause(boolean alwaysRedirectOnPause) { 51 this.alwaysRedirectOnPause = alwaysRedirectOnPause; 52 } 53 54 58 public void setRepositoryType(RepositoryType repositoryType) { 59 this.repositoryType = repositoryType; 60 } 61 62 69 public MutableAttributeMap applyExecutionAttributes(MutableAttributeMap executionAttributes) { 70 if (executionAttributes == null) { 71 executionAttributes = new LocalAttributeMap(1, 1); 72 } 73 if (!executionAttributes.contains(ApplicationViewSelector.ALWAYS_REDIRECT_ON_PAUSE_ATTRIBUTE)) { 74 executionAttributes.put(ApplicationViewSelector.ALWAYS_REDIRECT_ON_PAUSE_ATTRIBUTE, Boolean 75 .valueOf(alwaysRedirectOnPause)); 76 } 77 return executionAttributes; 78 } 79 80 86 public RepositoryType applyIfNecessary(RepositoryType selectedType) { 87 if (selectedType == null) { 88 return repositoryType; 89 } 90 else { 91 return selectedType; 92 } 93 } 94 95 public String toString() { 96 return new ToStringCreator(this).append("alwaysRedirectOnPause", alwaysRedirectOnPause).append( 97 "repositoryType", repositoryType).toString(); 98 } 99 } | Popular Tags |