Source Code Cross Referenced for BaseFlowBuilder.java in  » Workflow-Engines » spring-webflow-1.0.4 » org » springframework » webflow » engine » builder » 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.builder 
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.builder;
017:
018:        import org.springframework.binding.convert.ConversionException;
019:        import org.springframework.binding.convert.ConversionExecutor;
020:        import org.springframework.util.Assert;
021:        import org.springframework.webflow.core.collection.AttributeMap;
022:        import org.springframework.webflow.engine.Flow;
023:
024:        /**
025:         * Abstract base implementation of a flow builder defining common functionality
026:         * needed by most concrete flow builder implementations. This class implements
027:         * all optional parts of the FlowBuilder process as no-op methods. Subclasses
028:         * are only required to implement {@link #init(String, AttributeMap)} and
029:         * {@link #buildStates()}.
030:         * <p>
031:         * This class also provides a {@link FlowServiceLocator} for use by
032:         * subclasses in the flow construction process.
033:         * 
034:         * @see org.springframework.webflow.engine.builder.FlowServiceLocator
035:         * 
036:         * @author Keith Donald
037:         * @author Erwin Vervaet
038:         */
039:        public abstract class BaseFlowBuilder implements  FlowBuilder {
040:
041:            /**
042:             * The <code>Flow</code> built by this builder.
043:             */
044:            private Flow flow;
045:
046:            /**
047:             * Locates actions, attribute mappers, and other artifacts needed by the
048:             * flow built by this builder.
049:             */
050:            private FlowServiceLocator flowServiceLocator;
051:
052:            /**
053:             * Default constructor for subclassing. Sets up use of a {@link BaseFlowServiceLocator}.
054:             * @see #setFlowServiceLocator(FlowServiceLocator)
055:             */
056:            protected BaseFlowBuilder() {
057:                setFlowServiceLocator(new BaseFlowServiceLocator());
058:            }
059:
060:            /**
061:             * Creates a flow builder using the given locator to link in artifacts.
062:             * @param flowServiceLocator the locator for services needed by this builder to build its Flow
063:             */
064:            protected BaseFlowBuilder(FlowServiceLocator flowServiceLocator) {
065:                setFlowServiceLocator(flowServiceLocator);
066:            }
067:
068:            /**
069:             * Returns the configured flow service locator.
070:             */
071:            public FlowServiceLocator getFlowServiceLocator() {
072:                return flowServiceLocator;
073:            }
074:
075:            /**
076:             * Sets the flow service locator to use. Defaults to {@link BaseFlowServiceLocator}.
077:             */
078:            public void setFlowServiceLocator(
079:                    FlowServiceLocator flowServiceLocator) {
080:                Assert.notNull(flowServiceLocator,
081:                        "The flow service locator is required");
082:                this .flowServiceLocator = flowServiceLocator;
083:            }
084:
085:            /**
086:             * Set the flow being built by this builder. Typically called during
087:             * initialization to set the initial flow reference returned by
088:             * {@link #getFlow()} after building.
089:             */
090:            protected void setFlow(Flow flow) {
091:                this .flow = flow;
092:            }
093:
094:            public abstract void init(String flowId, AttributeMap attributes)
095:                    throws FlowBuilderException;
096:
097:            public void buildVariables() throws FlowBuilderException {
098:            }
099:
100:            public void buildInputMapper() throws FlowBuilderException {
101:            }
102:
103:            public void buildStartActions() throws FlowBuilderException {
104:            }
105:
106:            public void buildInlineFlows() throws FlowBuilderException {
107:            }
108:
109:            public abstract void buildStates() throws FlowBuilderException;
110:
111:            public void buildGlobalTransitions() throws FlowBuilderException {
112:            }
113:
114:            public void buildEndActions() throws FlowBuilderException {
115:            }
116:
117:            public void buildOutputMapper() throws FlowBuilderException {
118:            }
119:
120:            public void buildExceptionHandlers() throws FlowBuilderException {
121:            }
122:
123:            /**
124:             * Get the flow (result) built by this builder.
125:             */
126:            public Flow getFlow() {
127:                return flow;
128:            }
129:
130:            public void dispose() {
131:                setFlow(null);
132:            }
133:
134:            // helpers for use in subclasses
135:
136:            /**
137:             * Returns a conversion executor capable of converting string objects to the
138:             * target class aliased by the provided alias.
139:             * @param targetAlias the target class alias, e.g. "long" or "float"
140:             * @return the conversion executor, or <code>null</code> if no suitable
141:             * converter exists for given alias
142:             */
143:            protected ConversionExecutor fromStringTo(String targetAlias) {
144:                return getFlowServiceLocator().getConversionService()
145:                        .getConversionExecutorByTargetAlias(String.class,
146:                                targetAlias);
147:            }
148:
149:            /**
150:             * Returns a converter capable of converting a string value to the given
151:             * type.
152:             * @param targetType the type you wish to convert to (from a string)
153:             * @return the converter
154:             * @throws ConversionException when the converter cannot be found
155:             */
156:            protected ConversionExecutor fromStringTo(Class targetType)
157:                    throws ConversionException {
158:                return getFlowServiceLocator().getConversionService()
159:                        .getConversionExecutor(String.class, targetType);
160:            }
161:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.