01: //WebOnSwing - Web Application Framework
02: //Copyright (C) 2003 Fernando Damian Petrola
03: //
04: //This library is free software; you can redistribute it and/or
05: //modify it under the terms of the GNU Lesser General Public
06: //License as published by the Free Software Foundation; either
07: //version 2.1 of the License, or (at your option) any later version.
08: //
09: //This library is distributed in the hope that it will be useful,
10: //but WITHOUT ANY WARRANTY; without even the implied warranty of
11: //MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12: //Lesser General Public License for more details.
13: //
14: //You should have received a copy of the GNU Lesser General Public
15: //License along with this library; if not, write to the Free Software
16: //Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17:
18: package net.ar.webonswing.managers.templates;
19:
20: import java.io.*;
21:
22: import net.ar.webonswing.render.templates.*;
23:
24: public class HtmlTemplateManagerEntry implements Serializable,
25: Comparable {
26: protected String alias;
27: protected String resourcePath;
28: protected Template template;
29:
30: public HtmlTemplateManagerEntry() {
31: }
32:
33: public HtmlTemplateManagerEntry(String aTemplateName) {
34: alias = aTemplateName;
35: }
36:
37: public HtmlTemplateManagerEntry(String aTemplateName,
38: String aResourcePath, Template aTemplate) {
39: alias = aTemplateName;
40: resourcePath = aResourcePath;
41: template = aTemplate;
42: }
43:
44: public String getResourcePath() {
45: return resourcePath;
46: }
47:
48: public String getTemplateName() {
49: return alias;
50: }
51:
52: public void setResourcePath(String unString) {
53: resourcePath = unString;
54: }
55:
56: public void setTemplateName(String unString) {
57: alias = unString;
58: }
59:
60: public Template getTemplate() {
61: return template;
62: }
63:
64: public synchronized void setTemplate(Template unTemplate) {
65: template = unTemplate;
66: }
67:
68: public boolean equals(Object obj) {
69: if (obj instanceof HtmlTemplateManagerEntry)
70: return getTemplateName().equals(
71: ((HtmlTemplateManagerEntry) obj).getTemplateName());
72: else
73: return getTemplateName().equals(obj.toString());
74: }
75:
76: public int hashCode() {
77: return getTemplateName().hashCode();
78: }
79:
80: public int compareTo(Object o) {
81: if (o instanceof HtmlTemplateManagerEntry)
82: return getTemplateName().compareTo(
83: ((HtmlTemplateManagerEntry) o).getTemplateName());
84: else
85: return getTemplateName().compareTo(o.toString());
86: }
87:
88: }
|