001: /* Copyright (C) 2003 Finalist IT Group
002: *
003: * This file is part of JAG - the Java J2EE Application Generator
004: *
005: * JAG is free software; you can redistribute it and/or modify
006: * it under the terms of the GNU General Public License as published by
007: * the Free Software Foundation; either version 2 of the License, or
008: * (at your option) any later version.
009: * JAG is distributed in the hope that it will be useful,
010: * but WITHOUT ANY WARRANTY; without even the implied warranty of
011: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
012: * GNU General Public License for more details.
013: * You should have received a copy of the GNU General Public License
014: * along with JAG; if not, write to the Free Software
015: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
016: */
017:
018: package com.finalist.jag;
019:
020: import com.finalist.jag.template.*;
021:
022: /**
023: * Class PageContext
024: *
025: *
026: * @author Wendel D. de Witte
027: * @version %I%, %G%
028: */
029: public class PageContext {
030:
031: /** Field sessionContext */
032: private SessionContext sessionContext = null;
033:
034: /** Field headerCollection */
035: private TemplateHeaderCollection headerCollection = null;
036:
037: /** Field pageAttributes */
038: private AttributeMap pageAttributes = new AttributeMap();
039:
040: /** Field templateData */
041: private TemplateStructure templateData = null;
042:
043: /**
044: * Constructor PageContext
045: *
046: *
047: * @param sessionContext
048: *
049: */
050: public PageContext(SessionContext sessionContext) {
051: this .sessionContext = sessionContext;
052: }
053:
054: /**
055: * Method setHeaderCollection
056: *
057: *
058: * @param headerCollection
059: *
060: */
061: public void setHeaderCollection(
062: TemplateHeaderCollection headerCollection) {
063: this .headerCollection = headerCollection;
064: }
065:
066: /**
067: * Method setTemplateData
068: *
069: *
070: * @param templateData
071: *
072: */
073: public void setTemplateData(TemplateStructure templateData) {
074: this .templateData = templateData;
075: }
076:
077: /**
078: * Method getTextCollection
079: *
080: *
081: * @return
082: *
083: */
084: public TemplateTextBlockList getTextCollection() {
085:
086: if (templateData == null) {
087: return null;
088: }
089:
090: return templateData.getTextBlockList();
091: }
092:
093: /**
094: * Method getHeaderCollection
095: *
096: *
097: * @return
098: *
099: */
100: public TemplateHeaderCollection getHeaderCollection() {
101: return headerCollection;
102: }
103:
104: /**
105: * Method setAttribute
106: *
107: *
108: * @param name
109: * @param obj
110: *
111: */
112: public void setAttribute(String name, Object obj) {
113: pageAttributes.setAttribute(name, obj);
114: }
115:
116: /**
117: * Method removeAttribute
118: *
119: *
120: * @param name
121: *
122: */
123: public void removeAttribute(String name) {
124: pageAttributes.removeAttribute(name);
125: }
126:
127: /**
128: * Method getSessionContext
129: *
130: *
131: * @return
132: *
133: */
134: public SessionContext getSessionContext() {
135: return sessionContext;
136: }
137:
138: /**
139: * Method getTemplateData
140: *
141: *
142: * @return
143: *
144: */
145: public TemplateStructure getTemplateData() {
146: return templateData;
147: }
148:
149: /**
150: * Method getAttribute
151: *
152: *
153: * @param name
154: *
155: * @return
156: *
157: */
158: public Object getAttribute(String name) {
159: return pageAttributes.getAttribute(name);
160: }
161: };
|