KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > webdocwf > util > loader > generator > TableAttributes


1
2 /*
3 LoaderGenerator - tool for generated xml, sql and doml file needed for Octopus.
4
5
6     Copyright (C) 2003 Together
7
8     This library is free software; you can redistribute it and/or
9     modify it under the terms of the GNU Lesser General Public
10     License as published by the Free Software Foundation; either
11     version 2.1 of the License, or (at your option) any later version.
12
13     This library is distributed in the hope that it will be useful,
14     but WITHOUT ANY WARRANTY; without even the implied warranty of
15     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16     Lesser General Public License for more details.
17
18     You should have received a copy of the GNU Lesser General Public
19     License along with this library; if not, write to the Free Software
20     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 */

22
23 package org.webdocwf.util.loader.generator;
24
25 import org.webdocwf.util.loader.logging.Logger;
26 import org.webdocwf.util.loader.logging.StandardLogger;
27
28 /**
29  *
30  * TableAttributes class stores the value of table attributes, which are needed for
31  * creating ImportDefinition.xml file.
32  * @author Radoslav Dutina
33  * @version 1.0
34  */

35 public class TableAttributes {
36
37     private String JavaDoc tableName = "Table1";
38     private String JavaDoc tableID = "0";
39     private String JavaDoc insert = "true";
40     private String JavaDoc tableMode = "Query";
41     private String JavaDoc oidLogic = "true";
42     private Logger logger;
43
44     /**
45      * Construct object TableAttributes with associated parameters.
46      * @param tableName is name of the table form which we retrieve data.
47      * @param valueMode valueMode defines the difference from overwrite and update attribute.
48      */

49     public TableAttributes(String JavaDoc tableName, String JavaDoc valueMode) {
50         setLogger();
51         this.logger.write("full", "TableAttributes is started.");
52         this.tableName = tableName;
53         this.tableID = "0";
54         this.insert = "true";
55         this.tableMode = "Query";
56         if (valueMode.equalsIgnoreCase("Overwrite")) {
57             this.oidLogic = "false";
58         } else {
59             this.oidLogic = "true";
60         }
61         this.logger.write("full", "TableAttributes is finished.");
62     }
63
64     /**
65      * This method sets the value of tableName parameter.
66      * @param table_Name is the value of parameter.
67      */

68     public void setTableName(String JavaDoc table_Name) {
69         tableName = table_Name;
70     }
71
72     /**
73      * This method read the value of tableName parameter.
74      * @return value of parameter.
75      */

76     public String JavaDoc getTableName() {
77         return tableName;
78     }
79
80     /**
81      * This method sets the value of tableID parameter.
82      * @param table_ID is the value of parameter.
83      */

84     public void setTableID(String JavaDoc table_ID) {
85         tableID = table_ID;
86     }
87
88     /**
89      * This method read the value of tableID parameter.
90      * @return value of parameter.
91      */

92     public String JavaDoc getTableID() {
93         return tableID;
94     }
95
96     /**
97      * This method sets the value of insert parameter.
98      * @param _insert is the value of parameter.
99      */

100     public void setInsert(String JavaDoc _insert) {
101         insert = _insert;
102     }
103
104     /**
105      * This method read the value of insert parameter.
106      * @return value of parameter.
107      */

108     public String JavaDoc getInsert() {
109         return insert;
110     }
111
112     /**
113      * This method sets the value of tableMode parameter.
114      * @param table_Mode is the value of parameter.
115      */

116     public void setTableMode(String JavaDoc table_Mode) {
117         tableMode = table_Mode;
118     }
119
120     /**
121      * This method read the value of tableMode parameter.
122      * @return value of parameter.
123      */

124     public String JavaDoc getTableMode() {
125         return tableMode;
126     }
127
128     /**
129      * This method sets the value of oidLogic parameter.
130      * @param oid_Logic is the value of parameter.
131      */

132     public void setOidLogic(String JavaDoc oid_Logic) {
133         oidLogic = oid_Logic;
134     }
135
136     /**
137      * This method read the value of oidLogic parameter.
138      * @return value of parameter.
139      */

140     public String JavaDoc getOidLogic() {
141         return oidLogic;
142     }
143     /**
144                       * This method will set logger object
145                       * @param logger
146                       */

147     private void setLogger() {
148         this.logger = StandardLogger.getCentralLogger();
149     }
150 }
Popular Tags