KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > dbforms > config > DbEventInterceptorData


1 /*
2  * $Header: /cvsroot/jdbforms/dbforms/src/org/dbforms/config/DbEventInterceptorData.java,v 1.2 2005/02/19 21:26:27 hkollmann Exp $
3  * $Revision: 1.2 $
4  * $Date: 2005/02/19 21:26:27 $
5  *
6  * DbForms - a Rapid Application Development Framework
7  * Copyright (C) 2001 Joachim Peer <joepeer@excite.com>
8  *
9  * This library is free software; you can redistribute it and/or
10  * modify it under the terms of the GNU Lesser General Public
11  * License as published by the Free Software Foundation; either
12  * version 2.1 of the License, or (at your option) any later version.
13  *
14  * This library is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17  * Lesser General Public License for more details.
18  *
19  * You should have received a copy of the GNU Lesser General Public
20  * License along with this library; if not, write to the Free Software
21  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
22  */

23 package org.dbforms.config;
24 import java.sql.Connection JavaDoc;
25
26 import java.util.HashMap JavaDoc;
27 import java.util.Map JavaDoc;
28
29 import javax.servlet.http.HttpServletRequest JavaDoc;
30
31
32
33 /**
34  * Class to transport the data in the interceptors.
35  *
36  * @author hkk
37  */

38 public class DbEventInterceptorData {
39    
40     /** filled with FieldValues array during insert, delete and update events */
41    public static final String JavaDoc FIELDVALUES = "fieldValues";
42
43     /** filled with KeyValues string during delete and update events */
44    public static final String JavaDoc KEYVALUES = "keyValues";
45
46    /** filled with current ResultsetVector during AddRow and Select events */
47    public static final String JavaDoc RESULTSET = "ResultSetVector";
48
49    /** filled with objectrow which should be added during AddRow events */
50    public static final String JavaDoc OBJECTROW = "ObjectRow";
51
52    /** filled with the currently used connection name in all events */
53    public static final String JavaDoc CONNECTIONNAME = "connectionName";
54
55    /** filled with the pageContext during select events */
56    public static final String JavaDoc PAGECONTEXT = "pageContext";
57
58    
59    private HttpServletRequest JavaDoc request;
60    private DbFormsConfig config;
61    private Connection JavaDoc connection;
62    private Table table;
63    private Map JavaDoc attributes = new HashMap JavaDoc();
64
65    /**
66     * Creates a new DbEventInterceptorData object.
67     *
68     * @param request DOCUMENT ME!
69     * @param config DOCUMENT ME!
70     * @param connection DOCUMENT ME!
71     */

72    public DbEventInterceptorData(HttpServletRequest JavaDoc request,
73       DbFormsConfig config, Connection JavaDoc connection, Table table) {
74       this.request = request;
75       this.config = config;
76       this.connection = connection;
77       this.table = table;
78    }
79
80    /**
81     * DOCUMENT ME!
82     *
83     * @return DOCUMENT ME!
84     */

85    public Map JavaDoc getAttributesMap() {
86       return attributes;
87    }
88
89
90    /**
91     * reads a value from the attributes list
92     *
93     * @param key key to read
94     *
95     * @return The value. If not found null
96     */

97    public Object JavaDoc getAttribute(String JavaDoc key) {
98       return attributes.get(key);
99    }
100
101
102    /**
103     * Stores a value in the attributes list
104     *
105     * @param key key for the value
106     * @param value value to store
107     */

108    public void setAttribute(String JavaDoc key, Object JavaDoc value) {
109       attributes.put(key, value);
110    }
111
112
113    /**
114     * @return Returns the config.
115     */

116    public DbFormsConfig getConfig() {
117       return config;
118    }
119
120
121    /**
122     * @return Returns the connection.
123     */

124    public Connection JavaDoc getConnection() {
125       return connection;
126    }
127
128
129    /**
130     * @return Returns the request.
131     */

132    public HttpServletRequest JavaDoc getRequest() {
133       return request;
134    }
135
136
137    /**
138     * @return Returns the table.
139     */

140    public Table getTable() {
141       return table;
142    }
143 }
144
Popular Tags