KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > infohazard > maverick > view > NullViewFactory


1 /*
2  * $Id: NullViewFactory.java,v 1.2 2002/06/06 12:23:56 lhoriman Exp $
3  * $Source: /cvsroot/mav/maverick/src/java/org/infohazard/maverick/view/NullViewFactory.java,v $
4  */

5
6 package org.infohazard.maverick.view;
7
8 import org.infohazard.maverick.flow.*;
9 import org.jdom.Element;
10 import java.io.IOException JavaDoc;
11 import javax.servlet.ServletConfig JavaDoc;
12 import javax.servlet.ServletException JavaDoc;
13
14
15 /**
16  * <p>Creates a view which does absolutely nothing. The Controller
17  * is assumed to have manually written all data to the response. The
18  * model is ignored.</p>
19  *
20  * <p>Null views have no extra attributes and cannot have transforms.</p>
21  */

22 public class NullViewFactory implements ViewFactory
23 {
24     /**
25      */

26     static View singletonNull = new NullView();
27      
28     /**
29      */

30     public void init(Element factoryNode, ServletConfig JavaDoc servletCfg) throws ConfigException
31     {
32     }
33
34     /**
35      */

36     public View createView(Element viewNode) throws ConfigException
37     {
38         return singletonNull;
39     }
40     
41     /**
42      * Simple implementation does nothing.
43      */

44     public static class NullView implements View
45     {
46         /** Nothing! */
47         public void go(ViewContext vctx) throws IOException JavaDoc, ServletException JavaDoc
48         {
49         }
50     }
51 }
52
Popular Tags