~ubuntu-branches/ubuntu/trusty/libstruts1.2-java/trusty-proposed

« back to all changes in this revision

Viewing changes to src/share/org/apache/struts/taglib/tiles/DefinitionTagSupport.java

  • Committer: Bazaar Package Importer
  • Author(s): Arnaud Vandyck
  • Date: 2004-11-19 15:35:25 UTC
  • Revision ID: james.westby@ubuntu.com-20041119153525-mdu08a76z4zo67xt
Tags: upstream-1.2.4
ImportĀ upstreamĀ versionĀ 1.2.4

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * $Header: /home/cvs/jakarta-struts/src/share/org/apache/struts/taglib/tiles/DefinitionTagSupport.java,v 1.6 2004/04/24 06:37:00 rleland Exp $
 
3
 * $Revision: 1.6 $
 
4
 * $Date: 2004/04/24 06:37:00 $
 
5
 *
 
6
 * Copyright 1999-2004 The Apache Software Foundation.
 
7
 * 
 
8
 * Licensed under the Apache License, Version 2.0 (the "License");
 
9
 * you may not use this file except in compliance with the License.
 
10
 * You may obtain a copy of the License at
 
11
 * 
 
12
 *      http://www.apache.org/licenses/LICENSE-2.0
 
13
 * 
 
14
 * Unless required by applicable law or agreed to in writing, software
 
15
 * distributed under the License is distributed on an "AS IS" BASIS,
 
16
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 
17
 * See the License for the specific language governing permissions and
 
18
 * limitations under the License.
 
19
 */
 
20
package org.apache.struts.taglib.tiles;
 
21
 
 
22
import java.io.Serializable;
 
23
import javax.servlet.jsp.tagext.TagSupport;
 
24
 
 
25
/**
 
26
 * Common base class for tags dealing with Tiles definitions.
 
27
 * This class defines properties used in Definition Tags.
 
28
 * It also extends TagSupport.
 
29
 */
 
30
public class DefinitionTagSupport extends TagSupport implements Serializable {
 
31
    /**
 
32
     * Associated Controller type
 
33
     */
 
34
    protected String controllerType;
 
35
    /**
 
36
     * Associated Controller name (classname or url)
 
37
     */
 
38
    protected String controllerName;
 
39
    /**
 
40
     * Role associated to definition.
 
41
     */
 
42
    protected String role;
 
43
    /**
 
44
     * Uri of page assoicated to this definition.
 
45
     */
 
46
    protected String page;
 
47
 
 
48
    /**
 
49
     * Release class properties.
 
50
     */
 
51
    public void release() {
 
52
        super.release();
 
53
        controllerType = null;
 
54
        controllerName = null;
 
55
        role = null;
 
56
        page = null;
 
57
    }
 
58
 
 
59
    /**
 
60
     * Get controller type.
 
61
     * Type can be 'classname', 'url'.
 
62
     *
 
63
     * @return Controller type.
 
64
     */
 
65
    public String getControllerType() {
 
66
        return controllerType;
 
67
    }
 
68
 
 
69
    /**
 
70
     * Get controller name.
 
71
     * Name denotes a fully qualified classname, or an url.
 
72
     * Exact type can be specified with {@link #setControllerType}.
 
73
     *
 
74
     * @return Controller name.
 
75
     */
 
76
    public String getControllerName() {
 
77
        return controllerName;
 
78
    }
 
79
 
 
80
    /**
 
81
     * Set associated controller type.
 
82
     * Type denotes a fully qualified classname.
 
83
     *
 
84
     * @param controllerType Type of associated controller.
 
85
     */
 
86
    public void setControllerType(String controllerType) {
 
87
        this.controllerType = controllerType;
 
88
    }
 
89
 
 
90
    /**
 
91
     * Set associated controller name.
 
92
     * Name denotes a fully qualified classname, or an url.
 
93
     * Exact type can be specified with {@link #setControllerType}.
 
94
     *
 
95
     * @param controller Controller classname or url.
 
96
     */
 
97
    public void setController(String controller) {
 
98
        setControllerName(controller);
 
99
    }
 
100
 
 
101
    /**
 
102
     * Set associated controller name.
 
103
     * Name denote a fully qualified classname, or an url.
 
104
     * Exact type can be specified with setControllerType.
 
105
     *
 
106
     * @param controller Controller classname or url
 
107
     */
 
108
    public void setControllerName(String controller) {
 
109
        this.controllerName = controller;
 
110
    }
 
111
 
 
112
    /**
 
113
     * Set associated controller name as an url, and controller
 
114
     * type as "url".
 
115
     * Name must be an url (not checked).
 
116
     * Convenience method.
 
117
     *
 
118
     * @param controller Controller url
 
119
     */
 
120
    public void setControllerUrl(String controller) {
 
121
        setControllerName(controller);
 
122
        setControllerType("url");
 
123
    }
 
124
 
 
125
    /**
 
126
     * Set associated controller name as a classtype and controller
 
127
     * type as "classname".
 
128
     * Name denotes a fully qualified classname.
 
129
     * Convenience method.
 
130
     *
 
131
     * @param controller Controller classname.
 
132
     */
 
133
    public void setControllerClass(String controller) {
 
134
        setControllerName(controller);
 
135
        setControllerType("classname");
 
136
    }
 
137
 
 
138
    /**
 
139
     * Get associated role.
 
140
     *
 
141
     * @return Associated role.
 
142
     */
 
143
    public String getRole() {
 
144
        return role;
 
145
    }
 
146
 
 
147
    /**
 
148
     * Set associated role.
 
149
     *
 
150
     * @param role Associated role.
 
151
     */
 
152
    public void setRole(String role) {
 
153
        this.role = role;
 
154
    }
 
155
 
 
156
    /**
 
157
     * Set the page.
 
158
     *
 
159
     * @param page Page.
 
160
     */
 
161
    public void setPage(String page) {
 
162
        this.page = page;
 
163
    }
 
164
 
 
165
    /**
 
166
     * Get the page.
 
167
     *
 
168
     * @return Page.
 
169
     */
 
170
    public String getPage() {
 
171
        return page;
 
172
    }
 
173
 
 
174
    /**
 
175
     * Get the template.
 
176
     * Same as getPage().
 
177
     *
 
178
     * @return Template.
 
179
     */
 
180
    public String getTemplate() {
 
181
        return page;
 
182
    }
 
183
 
 
184
    /**
 
185
     * Set the template.
 
186
     * Same as setPage().
 
187
     *
 
188
     * @param template Template.
 
189
     */
 
190
    public void setTemplate(String template) {
 
191
        this.page = template;
 
192
    }
 
193
}