KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > springframework > webflow > engine > NullViewSelector


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.engine;
17
18 import java.io.ObjectStreamException JavaDoc;
19 import java.io.Serializable JavaDoc;
20
21 import org.springframework.webflow.execution.RequestContext;
22 import org.springframework.webflow.execution.ViewSelection;
23
24 /**
25  * Makes a null view selection, indicating no response should be issued.
26  *
27  * @see org.springframework.webflow.execution.ViewSelection#NULL_VIEW
28  *
29  * @author Keith Donald
30  */

31 public final class NullViewSelector implements ViewSelector, Serializable JavaDoc {
32
33     /*
34      * Implementation note: not located in webflow.execution.support package to
35      * avoid a cyclic dependency between webflow.execution and webflow.execution.support.
36      */

37
38     /**
39      * The shared singleton {@link NullViewSelector} instance.
40      */

41     public static final ViewSelector INSTANCE = new NullViewSelector();
42
43     /**
44      * Private constructor since this is a singleton.
45      */

46     private NullViewSelector() {
47     }
48
49     public boolean isEntrySelectionRenderable(RequestContext context) {
50         return true;
51     }
52
53     public ViewSelection makeEntrySelection(RequestContext context) {
54         return ViewSelection.NULL_VIEW;
55     }
56
57     public ViewSelection makeRefreshSelection(RequestContext context) {
58         return makeEntrySelection(context);
59     }
60
61     // resolve the singleton instance
62
private Object JavaDoc readResolve() throws ObjectStreamException JavaDoc {
63         return INSTANCE;
64     }
65     
66 }
Popular Tags