KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > finalist > jag > PageContext


1 /* Copyright (C) 2003 Finalist IT Group
2  *
3  * This file is part of JAG - the Java J2EE Application Generator
4  *
5  * JAG is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation; either version 2 of the License, or
8  * (at your option) any later version.
9  * JAG 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
12  * GNU General Public License for more details.
13  * You should have received a copy of the GNU General Public License
14  * along with JAG; if not, write to the Free Software
15  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16  */

17
18 package com.finalist.jag;
19
20
21 import com.finalist.jag.template.*;
22
23
24 /**
25  * Class PageContext
26  *
27  *
28  * @author Wendel D. de Witte
29  * @version %I%, %G%
30  */

31 public class PageContext {
32
33    /** Field sessionContext */
34    private SessionContext sessionContext = null;
35
36    /** Field headerCollection */
37    private TemplateHeaderCollection headerCollection = null;
38
39    /** Field pageAttributes */
40    private AttributeMap pageAttributes = new AttributeMap();
41
42    /** Field templateData */
43    private TemplateStructure templateData = null;
44
45
46    /**
47     * Constructor PageContext
48     *
49     *
50     * @param sessionContext
51     *
52     */

53    public PageContext(SessionContext sessionContext) {
54       this.sessionContext = sessionContext;
55    }
56
57
58    /**
59     * Method setHeaderCollection
60     *
61     *
62     * @param headerCollection
63     *
64     */

65    public void setHeaderCollection(
66       TemplateHeaderCollection headerCollection) {
67       this.headerCollection = headerCollection;
68    }
69
70
71    /**
72     * Method setTemplateData
73     *
74     *
75     * @param templateData
76     *
77     */

78    public void setTemplateData(TemplateStructure templateData) {
79       this.templateData = templateData;
80    }
81
82
83    /**
84     * Method getTextCollection
85     *
86     *
87     * @return
88     *
89     */

90    public TemplateTextBlockList getTextCollection() {
91
92       if (templateData == null) {
93          return null;
94       }
95
96       return templateData.getTextBlockList();
97    }
98
99
100    /**
101     * Method getHeaderCollection
102     *
103     *
104     * @return
105     *
106     */

107    public TemplateHeaderCollection getHeaderCollection() {
108       return headerCollection;
109    }
110
111
112    /**
113     * Method setAttribute
114     *
115     *
116     * @param name
117     * @param obj
118     *
119     */

120    public void setAttribute(String JavaDoc name, Object JavaDoc obj) {
121       pageAttributes.setAttribute(name, obj);
122    }
123
124
125    /**
126     * Method removeAttribute
127     *
128     *
129     * @param name
130     *
131     */

132    public void removeAttribute(String JavaDoc name) {
133       pageAttributes.removeAttribute(name);
134    }
135
136
137    /**
138     * Method getSessionContext
139     *
140     *
141     * @return
142     *
143     */

144    public SessionContext getSessionContext() {
145       return sessionContext;
146    }
147
148
149    /**
150     * Method getTemplateData
151     *
152     *
153     * @return
154     *
155     */

156    public TemplateStructure getTemplateData() {
157       return templateData;
158    }
159
160
161    /**
162     * Method getAttribute
163     *
164     *
165     * @param name
166     *
167     * @return
168     *
169     */

170    public Object JavaDoc getAttribute(String JavaDoc name) {
171       return pageAttributes.getAttribute(name);
172    }
173 }
174
175 ;
176
Popular Tags