KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > tonbeller > wcf > param > SessionParam


1 package com.tonbeller.wcf.param;
2
3 /**
4  * @author av
5  * @since 31.01.2005
6  */

7 public class SessionParam implements Cloneable JavaDoc {
8
9   String JavaDoc displayName;
10   String JavaDoc displayValue;
11   String JavaDoc name;
12   SqlExpr sqlExpr;
13   String JavaDoc mdxValue;
14   String JavaDoc textValue;
15   
16   /**
17    * returns a text value as entered in the jsp
18    */

19   public String JavaDoc getTextValue() {
20     return textValue;
21   }
22   
23   /**
24    * sets a text value as enterd in the jsp
25    */

26   public void setTextValue(String JavaDoc textValue) {
27     this.textValue = textValue;
28   }
29
30   /**
31    * returns the value returned by the expression parser.
32    * For example the unique name like "[Customers].[Name].[Andreas Voss]"
33    * @see com.tonbeller.jpivot.olap.navi.ExpressionParser
34    */

35   public String JavaDoc getMdxValue() {
36     return mdxValue;
37   }
38
39   /**
40    * sets the value returned by the expression parser.
41    * For example the unique name like "[Customers].[Name].[Customer 287]"
42    * @see com.tonbeller.jpivot.olap.navi.ExpressionParser
43    */

44   public void setMdxValue(String JavaDoc mdxValue) {
45     this.mdxValue = mdxValue;
46   }
47   
48   public SqlExpr getSqlExpr() {
49     return sqlExpr;
50   }
51   
52   public void setSqlExpr(SqlExpr sqlExpr) {
53     this.sqlExpr = sqlExpr;
54   }
55   
56   /**
57    * shorthand for getting/setting the sqlValue of a SqlEqualExpr
58    */

59   public Object JavaDoc getSqlValue() {
60     if (sqlExpr == null)
61       return null;
62     if (!(sqlExpr instanceof SqlEqualExpr))
63       throw new IllegalStateException JavaDoc("SqlEqualExpr required");
64     return ((SqlEqualExpr)sqlExpr).getSqlValue();
65   }
66   
67   /**
68    * shorthand for getting/setting the sqlValue of a SqlEqualExpr
69    */

70   public void setSqlValue(Object JavaDoc sqlValue) {
71     SqlEqualExpr expr = new SqlEqualExpr();
72     expr.setSqlValue(sqlValue);
73     setSqlExpr(expr);
74   }
75
76   /**
77    * returns the name of the parameter for display to the user.
78    * For example "Customer"
79    */

80   public String JavaDoc getDisplayName() {
81     return displayName;
82   }
83
84   /**
85    * sets the name of the parameter for display to the user
86    * For example "Customer"
87    */

88   public void setDisplayName(String JavaDoc displayName) {
89     this.displayName = displayName;
90   }
91   
92   /**
93    * returns the parameter value for display to the user
94    * For example "Andreas Voss"
95    */

96   public String JavaDoc getDisplayValue() {
97     return displayValue;
98   }
99
100   /**
101    * sets the parameter value for display to the user
102    * For example "Andreas Voss"
103    */

104   public void setDisplayValue(String JavaDoc displayValue) {
105     this.displayValue = displayValue;
106   }
107
108   /**
109    * returns the name that identifies this parameter within the {@link SessionParamPool}.
110    * For example, the customer ID.
111    */

112   public String JavaDoc getName() {
113     return name;
114   }
115
116   /**
117    * sets the name that identifies this parameter within the {@link SessionParamPool}.
118    * For example, the customer ID.
119    */

120   public void setName(String JavaDoc name) {
121     this.name = name;
122   }
123   
124   public Object JavaDoc clone() throws CloneNotSupportedException JavaDoc {
125     SessionParam p = (SessionParam) super.clone();
126     SqlExpr x = (SqlExpr) sqlExpr.clone();
127     p.setSqlExpr(x);
128     return p;
129   }
130
131 }
132
Popular Tags