1 package com.instantbank.servicing.setParameterXValue.web;
2
3 import java.io.*;
4 import java.net.*;
5 import java.util.*;
6 import javax.naming.*;
7 import javax.rmi.*;
8 import javax.servlet.http.HttpServletRequest;
9
10 import oracle.xml.parser.v2.*;
11 import org.w3c.dom.*;
12 import org.xml.sax.*;
13 import com.instantbank.servicing.control.util.WebKeys;
14 import com.instantbank.common.utilcomponents.CodeDescription;
15 import com.instantbank.common.utilcomponents.Debug;
16 import com.instantbank.component.parameter.util.*;
17
18
24 public class SetParameterXValueTranslator
25 implements Serializable {
26
27
28 private ArrayList point1;
29 private ArrayList point2;
30 private String[] valuePoint1;
31 private String[] valuePoint2;
32 private int point1Length;
33 private int point2Length;
34
35 private Debug debug = null;
36
37
38
44 public void setData(HttpServletRequest request) {
45
46 debug = new Debug();
47 debug.setDebugginOn(true);
48 debug.setPreMessage("** SetParameterXValueTranslator: ");
49
50 try {
51 ParameterModel parm = (ParameterModel)
52 request.getAttribute(WebKeys.SetParameterXValueList);
53
54 point1 = parm.getLevel1Point();
55 point2 = parm.getLevel2Point();
56
57 point1Length = point1.size();
58 point2Length = point2.size();
59
60 debug.println("parameter values obtained");
61
62 valuePoint1 = new String[point1Length];
63 valuePoint2 = new String[point2Length];
64
65 for(int i = 0; i < point1Length; i++) {
66 valuePoint1[i] = (String)point1.get(i);
67 }
68
69 for(int i = 0; i < point2Length; i++) {
70 valuePoint2[i] = (String)point2.get(i);
71 }
72 }
73 catch(Exception e) {
74 debug.println("Exception unexpected:" + e.getMessage());
75 }
76 }
77
78
79
85 public String getPoint1Array() {
86 String Head = null;
87 String Body = null;
88 char Ch = '"';
89
90 Head = "numberOfItemsPoint1 = " + point1Length + "; \n";
91 Body = "";
92 for(int i = 0; i < point1Length; i++) {
93 Body = Body +
94 "itemsArrayPoint1[" + i
95 + "] = new ItemPoint1("
96 + Ch + valuePoint1[i] + Ch +
97 ");\n";
98 }
99 return (Head + Body);
100 }
101
102
103
109 public String getPoint2Array() {
110 String Head = null;
111 String Body = null;
112 char Ch = '"';
113
114 Head = "numberOfItemsPoint2 = " + point2Length + "; \n";
115 Body = "";
116 for(int i = 0; i < point2Length; i++) {
117 Body = Body +
118 "itemsArrayPoint2[" + i
119 + "] = new ItemPoint2("
120 + Ch + valuePoint2[i] + Ch +
121 ");\n";
122 }
123 return (Head + Body);
124 }
125
126 }
127
128