KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > web > layout > Page


1 /*
2  * This program is free software; you can redistribute it and/or modify
3  * it under the terms of the GNU General Public License as published by
4  * the Free Software Foundation; either version 2 of the License, or
5  * (at your option) any later version.
6  *
7  * This program is distributed in the hope that it will be useful,
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10  * GNU Library General Public License for more details.
11  *
12  * You should have received a copy of the GNU General Public License
13  * along with this program; if not, write to the Free Software
14  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
15  */

16 package web.layout;
17
18 import dlog4j.util.StringUtils;
19
20 /**
21  * 对应layout.xml中的一个page
22  * @author Winter Lau
23  */

24 public class Page {
25     String JavaDoc name;
26     String JavaDoc uri;
27     String JavaDoc param;
28     
29     public String JavaDoc getName() {
30         return name;
31     }
32     public void setName(String JavaDoc name) {
33         this.name = name;
34     }
35     public String JavaDoc getParam() {
36         return param;
37     }
38     public void setParam(String JavaDoc param) {
39         this.param = param;
40     }
41     public String JavaDoc getUri() {
42         return uri;
43     }
44     public void setUri(String JavaDoc uri) {
45         this.uri = uri;
46     }
47     public boolean equals(Object JavaDoc obj) {
48         if(this==obj)
49             return true;
50         if(obj instanceof Page){
51             Page p = (Page)obj;
52             return StringUtils.equals(name, p.getName()) &&
53                    StringUtils.equals(uri, p.getUri()) &&
54                    StringUtils.equals(param, p.getParam());
55         }
56         return false;
57     }
58     public String JavaDoc toString() {
59         StringBuffer JavaDoc sb = new StringBuffer JavaDoc();
60         sb.append("NAME:");
61         sb.append(name);
62         sb.append(",URI:");
63         sb.append(uri);
64         sb.append(",PARAM:");
65         sb.append(param);
66         return sb.toString();
67     }
68     
69     public Object JavaDoc clone(){
70         Page p = new Page();
71         p.setName(name);
72         p.setParam(param);
73         p.setUri(uri);
74         return p;
75     }
76 }
77
Popular Tags