1 package org.opensync.tools;
2
3 /*
4 import java.util.HashMap;
5 import java.io.IOException;
6 import java.sql.SQLException;
7 import org.xml.sax.SAXException;
8 import javax.xml.parsers.ParserConfigurationException;
9
10 import org.opensync.tools.Utils;
11 import org.opensync.importexport.ViewXml;
12 import org.opensync.importexport.View;
13 import org.opensync.tools.MacroProcessor;
14 */
15
16 /***
17 * Holds conditional data used in both the sql where clause and url query.
18 * @version 1.0
19 * @author Keith Stumpf
20 */
21
22 public class ConditionalData{
23
24 private String m_sThemeKeyword;
25 private String m_sWhereKeyword;
26 private String m_sMacro;
27 private String m_sOperator;
28
29 /*
30 * Default constructor
31 */
32 public ConditionalData(){
33 }
34
35 /*
36 * Returns the keyword of the element in the theme
37 * @return String Keyword of the element in the theme
38 */
39 public String getThemeKeyword(){
40 return m_sThemeKeyword;
41 }
42
43 /*
44 * Sets the keyword of the element in the theme
45 * @param sThemeKeyword Keyword of the element in the theme
46 */
47 public void setThemeKeyword(String sThemeKeyword){
48 this.m_sThemeKeyword = sThemeKeyword;
49 }
50
51 /*
52 * Returns the keyword used in the sql where clause.
53 * @return String Keyword used in the sql where clause.
54 */
55 public String getWhereKeyword(){
56 return m_sWhereKeyword;
57 }
58
59 /*
60 * Sets the keyword used in the sql where clause.
61 * @param sWhereKeyword Keyword used in the sql where clause.
62 */
63 public void setWhereKeyword(String sWhereKeyword){
64 this.m_sWhereKeyword = sWhereKeyword;
65 }
66
67 /*
68 * Returns the macro used to build the right hand side of the conditional expression.
69 * @return String Macro used to build the right hand side of the conditional expression.
70 */
71 public String getMacro(){
72 return m_sMacro;
73 }
74
75 /*
76 * Sets the macro used to build the right hand side of the conditional expression.
77 * @param sMacro Macro used to build the right hand side of the conditional expression.
78 */
79 public void setMacro(String sMacro){
80 this.m_sMacro = sMacro;
81 }
82
83 /*
84 * Returns the operator used in the url
85 * @return String the operator used in the url
86 */
87 public String getOperator(){
88 return m_sOperator;
89 }
90
91 /*
92 * Sets the operator used in the url
93 * @param sOperator The operator used in the url
94 */
95 public void setOperator(String sOperator){
96 this.m_sOperator = sOperator;
97 }
98
99
100 /*
101 * Helper method to create a string representation of this object.
102 * @return String String representation of this object.
103 */
104 public String toString(){
105 StringBuffer sb=new StringBuffer();
106 sb.append("\nConditionalData Info ...\n");
107 sb.append("Theme keyword: " + getThemeKeyword() + "\n");
108 sb.append("Where keyword: " + getWhereKeyword() + "\n");
109 sb.append("Macro: " + getMacro() + "\n");
110 sb.append("Operator: " + getOperator() + "\n");
111 return sb.toString();
112 }
113
114 }