KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > springframework > webflow > execution > ViewSelection


1 /*
2  * Copyright 2002-2006 the original author or authors.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */

16 package org.springframework.webflow.execution;
17
18 import java.io.ObjectStreamException JavaDoc;
19 import java.io.Serializable JavaDoc;
20
21 /**
22  * Abstract base class for value objects that provide callers into a flow
23  * execution information about a logical response to issue and the data
24  * necessary to issue it.
25  * <p>
26  * This class is a generic marker returned when a request into an executing flow
27  * has completed processing, indicating a client response needs to be issued. An
28  * instance of a ViewSelection subclass represents the selection of a concrete
29  * response type. It is expected that callers introspect the returned view
30  * selection instance to handle the response types they support.
31  *
32  * @see FlowExecution
33  *
34  * @author Keith Donald
35  * @author Erwin Vervaet
36  */

37 public abstract class ViewSelection implements Serializable JavaDoc {
38
39     /**
40      * Constant for a <code>null</code> or empty view selection, indicating no
41      * response should be issued.
42      */

43     public static final ViewSelection NULL_VIEW = new NullView();
44
45     /**
46      * The definition of the 'null' view selection type, indicating that no
47      * response should be issued.
48      */

49     private static final class NullView extends ViewSelection {
50
51         // resolve the singleton instance
52
private Object JavaDoc readResolve() throws ObjectStreamException JavaDoc {
53             return NULL_VIEW;
54         }
55
56         public String JavaDoc toString() {
57             return "null";
58         }
59     }
60 }
Popular Tags