Source Code Cross Referenced for ViewState.java in  » Workflow-Engines » spring-webflow-1.0.4 » org » springframework » webflow » engine » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Workflow Engines » spring webflow 1.0.4 » org.springframework.webflow.engine 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * Copyright 2004-2007 the original author or authors.
003:         *
004:         * Licensed under the Apache License, Version 2.0 (the "License");
005:         * you may not use this file except in compliance with the License.
006:         * You may obtain a copy of the License at
007:         *
008:         *      http://www.apache.org/licenses/LICENSE-2.0
009:         *
010:         * Unless required by applicable law or agreed to in writing, software
011:         * distributed under the License is distributed on an "AS IS" BASIS,
012:         * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013:         * See the License for the specific language governing permissions and
014:         * limitations under the License.
015:         */
016:        package org.springframework.webflow.engine;
017:
018:        import org.springframework.core.style.ToStringCreator;
019:        import org.springframework.util.Assert;
020:        import org.springframework.webflow.execution.FlowExecutionException;
021:        import org.springframework.webflow.execution.RequestContext;
022:        import org.springframework.webflow.execution.ViewSelection;
023:
024:        /**
025:         * A view state is a state that issues a response to the user, for
026:         * example, for soliciting form input.
027:         * <p>
028:         * To accomplish this, a <code>ViewState</code> makes a {@link ViewSelection},
029:         * which contains the necessary information to issue a suitable response.
030:         * 
031:         * @see org.springframework.webflow.engine.ViewSelector
032:         * 
033:         * @author Keith Donald
034:         * @author Erwin Vervaet
035:         */
036:        public class ViewState extends TransitionableState {
037:
038:            /**
039:             * The list of actions to be executed when this state is entered.
040:             */
041:            private ActionList renderActionList = new ActionList();
042:
043:            /**
044:             * The factory for the view selection to return when this state is entered.
045:             */
046:            private ViewSelector viewSelector = NullViewSelector.INSTANCE;
047:
048:            /**
049:             * Create a new view state.
050:             * @param flow the owning flow
051:             * @param id the state identifier (must be unique to the flow)
052:             * @throws IllegalArgumentException when this state cannot be added to given
053:             * flow, e.g. because the id is not unique
054:             */
055:            public ViewState(Flow flow, String id)
056:                    throws IllegalArgumentException {
057:                super (flow, id);
058:            }
059:
060:            /**
061:             * Returns the strategy used to select the view to render in this view
062:             * state.
063:             */
064:            public ViewSelector getViewSelector() {
065:                return viewSelector;
066:            }
067:
068:            /**
069:             * Sets the strategy used to select the view to render in this view state.
070:             */
071:            public void setViewSelector(ViewSelector viewSelector) {
072:                Assert
073:                        .notNull(viewSelector,
074:                                "The view selector to make view selections is required");
075:                this .viewSelector = viewSelector;
076:            }
077:
078:            /**
079:             * Returns the list of actions executable by this view state on entry and on
080:             * refresh. The returned list is mutable.
081:             * @return the state action list
082:             */
083:            public ActionList getRenderActionList() {
084:                return renderActionList;
085:            }
086:
087:            /**
088:             * Specialization of State's <code>doEnter</code> template method that
089:             * executes behavior specific to this state type in polymorphic fashion.
090:             * <p>
091:             * Returns a view selection indicating a response to issue. The view
092:             * selection typically contains all the data necessary to issue the
093:             * response.
094:             * @param context the control context for the currently executing flow, used
095:             * by this state to manipulate the flow execution
096:             * @return a view selection serving as a response instruction
097:             * @throws FlowExecutionException if an exception occurs in this state
098:             */
099:            protected ViewSelection doEnter(RequestControlContext context)
100:                    throws FlowExecutionException {
101:                if (viewSelector.isEntrySelectionRenderable(context)) {
102:                    // the entry selection will be rendered!
103:                    renderActionList.execute(context);
104:                }
105:                return viewSelector.makeEntrySelection(context);
106:            }
107:
108:            /**
109:             * Request that the current view selection be reconstituted to support
110:             * reissuing the response. This is an idempotent operation that may be
111:             * safely called any number of times on a paused execution, used primarily
112:             * to support a flow execution redirect.
113:             * @param context the request context
114:             * @return the view selection
115:             * @throws FlowExecutionException if an exception occurs in this state
116:             */
117:            public ViewSelection refresh(RequestContext context)
118:                    throws FlowExecutionException {
119:                renderActionList.execute(context);
120:                return viewSelector.makeRefreshSelection(context);
121:            }
122:
123:            protected void appendToString(ToStringCreator creator) {
124:                creator.append("viewSelector", viewSelector);
125:                super.appendToString(creator);
126:            }
127:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.