View Javadoc

1   /*
2    * $Id: View.java 121 2004-11-01 13:05:23Z josem $
3    *
4    * Tarsis
5    * Copyright (C) 2002 Talika Open Source Group
6    *
7    * This program is free software; you can redistribute it and/or modify
8    * it under the terms of the GNU General Public License as published by
9    * the Free Software Foundation; either version 2 of the License, or
10   * (at your option) any later version.
11   *
12   * This program is distributed in the hope that it will be useful,
13   * but WITHOUT ANY WARRANTY; without even the implied warranty of
14   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15   * GNU General Public License for more details.
16   *
17   * You should have received a copy of the GNU General Public License
18   * along with this program; if not, write to the Free Software
19   * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
20   *
21   */
22  
23  package org.talika.tarsis.command.view;
24  
25  /**
26   * Interface that defines a view in Tarsis MVC Framework.<br>
27   * <br>
28   * The command view is the piece of software responsible of presentation logic.
29   * A view is executed after when command action is finished.<br>
30   * Views are servlets, JSP pages, HTML pages and any other web artifact which we
31   * can forward, redirect or include.<br>
32   * <br>
33   * View type can be FORWARD, REDIRECT or INCLUDE depending on invokation's method.
34   * FORWARD view is invoked using <code>dispatch</code> method, REDIRECT view is
35   * invoked using <code>sendRedirect</code> method and INCLUDE using <code>include</code>
36   * method.
37   *
38   * @author  Jose M. Palomar
39   * @version $Revision: 121 $
40   * @see org.talika.tarsis.command.Command
41   * @see org.talika.tarsis.command.action.Action
42   */
43  public interface View {
44  
45      // Constants
46      /**
47       * Forward view type.
48       */
49      int FORWARD = 0;
50  
51      /**
52       * Redirect view type.
53       */
54      int REDIRECT = 1;
55  
56      /**
57       * Include view type.
58       */
59      int INCLUDE = 2;
60  
61      /**
62       * Default view name.
63       */
64      String DEFAULT_VIEW_NAME = "default";
65  
66      /**
67       * Input view name.
68       */
69      String INPUT_VIEW_NAME = "input";
70  
71      // Methods
72      /**
73       * Returns view's type.
74       *
75       * @return int view's type.
76       */
77      int getType();
78  
79      /**
80       * Returns name of view.
81       *
82       * @return String name of view.
83       */
84      String getName();
85  
86      /**
87       * Returns path fo view.
88       *
89       * @return String path fo view.
90       */
91      String getPath();
92  
93  }