KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > csdl > stackmvc > control > Page


1 package csdl.stackmvc.control;
2
3 /**
4  * Provides a type-safe enumeration for JSP Page names.
5  *
6  * @author Philip M. Johnson
7  * @author Jitender Miglani (did minor changes)
8  */

9 public class Page {
10   /** The filename of the JSP page */
11   private final String JavaDoc fileName;
12
13   /** The title of the JSP page */
14   private final String JavaDoc title;
15
16   /** Error page for exceptions. */
17   public static final Page ERROR = new Page("/Error.jsp", "Error Page");
18
19   /** Home page for application */
20   public static final Page INDEX = new Page("/index.jsp", "Home Page");
21
22   /**
23    * Constructs the JSP Page instance
24    * @param fileName The filename of the JSP page
25    * @param title The title of the JSP page
26    */

27   private Page(String JavaDoc fileName, String JavaDoc title) {
28     this.fileName = fileName;
29     this.title = title;
30   }
31
32
33   /**
34    * Gets the title attribute of the Page object.
35    *
36    * @return The title value
37    */

38   public String JavaDoc getTitle() {
39     return this.title;
40   }
41
42
43   /**
44    * Gets the fileName attribute of the Page object.
45    *
46    * @return The fileName value
47    */

48   public String JavaDoc getFileName() {
49     return this.fileName;
50   }
51 }
52
Popular Tags