1 package com.instantbank.collections.creditInfo.web;
2
3 import java.io.ByteArrayInputStream;
4 import oracle.xml.parser.v2.DOMParser;
5 import oracle.xml.parser.v2.XMLDocument;
6 import oracle.xml.parser.v2.XMLElement;
7 import oracle.xml.parser.v2.XMLNode;
8 import oracle.xml.parser.v2.XSLException;
9 import com.instantbank.collections.util.StringFormat;
10
11 public class AccountDetailsContTransformer {
12
13 private String accountDetailsContXmlString;
14 private XMLDocument accountDetailsContXml;
15 private XMLNode addressNode;
16 private XMLNode agreementDetailsContNode;
17 private XMLNode primaryNode;
18 private XMLNode statusValuesNode;
19
20
21 public AccountDetailsContTransformer() { }
22
23
24 public String getAccountNumber() throws XSLException, Exception {
25 return StringFormat.toSafeHTMLString(agreementDetailsContNode.valueOf("./accountnumber"));
26 }
27
28
29 public String getBehaveioral() throws XSLException, Exception {
30 return agreementDetailsContNode.valueOf("./behaveioral");
31 }
32
33
34 public String getClassifiedCode() throws XSLException, Exception {
35 return agreementDetailsContNode.valueOf("./classifiedcode");
36 }
37
38
39 public String getCollOfficer() throws XSLException, Exception {
40 return agreementDetailsContNode.valueOf("./collofficer");
41 }
42
43
44 public String getContractState() throws XSLException, Exception {
45 return agreementDetailsContNode.valueOf("./contractstate");
46 }
47
48
49 public String getCurrentCrBur() throws XSLException, Exception {
50 return agreementDetailsContNode.valueOf("./currentcrbur");
51 }
52
53
54 public String getDelinquecy() throws XSLException, Exception {
55 return agreementDetailsContNode.valueOf("./delinquency");
56 }
57
58
59 public String getDueDay() throws XSLException, Exception {
60 return agreementDetailsContNode.valueOf("./dueday");
61 }
62
63
64 public String getFirstName() throws XSLException, Exception {
65 return primaryNode.valueOf("./firstname");
66 }
67
68
69 public String getFirstPayment() throws XSLException, Exception {
70 return agreementDetailsContNode.valueOf("./firstpayment");
71 }
72
73
74 public String getFinanced() throws XSLException, Exception {
75 return agreementDetailsContNode.valueOf("./financed");
76 }
77
78
79 public String getGenerationCode() throws XSLException, Exception {
80 return primaryNode.valueOf("./generationcode");
81 }
82
83
84 public String getGlCode() throws XSLException, Exception {
85 return agreementDetailsContNode.valueOf("./glcode");
86 }
87
88
89 public String getLastCustContact() throws XSLException, Exception {
90 return agreementDetailsContNode.valueOf("./lastcustcont");
91 }
92
93
94 public String getLastExtension() throws XSLException, Exception {
95 return agreementDetailsContNode.valueOf("./lastextension");
96 }
97
98
99 public String getLastName() throws XSLException, Exception {
100 return primaryNode.valueOf("./lastname");
101 }
102
103
104 public String getLoanClass() throws XSLException, Exception {
105 return agreementDetailsContNode.valueOf("./class");
106 }
107
108
109 public String getLoanType() throws XSLException, Exception {
110 return agreementDetailsContNode.valueOf("./loantype");
111 }
112
113
114 public String getMatDate() throws XSLException, Exception {
115 return agreementDetailsContNode.valueOf("./matdate");
116 }
117
118
119 public String getMiddleName() throws XSLException, Exception {
120 return primaryNode.valueOf("./middlename");
121 }
122
123
124 public String getOriginalCrBur() throws XSLException, Exception {
125 return agreementDetailsContNode.valueOf("./originalcrbur");
126 }
127
128
129 public String getPaymentsMade() throws XSLException, Exception {
130 return agreementDetailsContNode.valueOf("./paymentsmade");
131 }
132
133
134 public String getPoolNumber() throws XSLException, Exception {
135 return agreementDetailsContNode.valueOf("./poolnumber");
136 }
137
138
139 public String getPrinDue() throws XSLException, Exception {
140 return agreementDetailsContNode.valueOf("./prindue");
141 }
142
143
144 public String getRecoveryCode() throws XSLException, Exception {
145 return agreementDetailsContNode.valueOf("./recoverycode");
146 }
147
148
149 public String getStatus() throws XSLException, Exception {
150 return agreementDetailsContNode.valueOf("./status");
151 }
152
153
154 public String getTerm() throws XSLException, Exception {
155 return agreementDetailsContNode.valueOf("./term");
156 }
157
158
159 public String getTicklerCode1() throws XSLException, Exception {
160 return agreementDetailsContNode.valueOf("./ticklercode1");
161 }
162
163
164 public String getTicklerCode2() throws XSLException, Exception {
165 return agreementDetailsContNode.valueOf("./ticklercode2");
166 }
167
168
169 public String getTicklerDate1() throws XSLException, Exception {
170 return agreementDetailsContNode.valueOf("./ticklerdate1");
171 }
172
173
174 public String getTicklerDate2() throws XSLException, Exception {
175 return agreementDetailsContNode.valueOf("./ticklerdate2");
176 }
177
178
179 public String getTermination() throws XSLException, Exception {
180 return agreementDetailsContNode.valueOf("./termination");
181 }
182
183
184 public String getUnpaidFee1() throws XSLException, Exception {
185 return agreementDetailsContNode.valueOf("./unpaidfee1");
186 }
187
188
189 public String getUnpaidFee2() throws XSLException, Exception {
190 return agreementDetailsContNode.valueOf("./unpaidfee2");
191 }
192
193
194 public String getPaymentsPastDue() throws XSLException, Exception {
195 return agreementDetailsContNode.valueOf("./paymentspastdue");
196 }
197
198
199 public void setData(String data) throws Exception {
200 DOMParser docParser = new DOMParser();
201 XMLElement primaryElement;
202 ByteArrayInputStream stream;
203
204 try {
205 stream = new ByteArrayInputStream(data.getBytes());
206 docParser.setValidationMode(false);
207 docParser.parse(stream);
208 accountDetailsContXmlString = data;
209 accountDetailsContXml = docParser.getDocument();
210 primaryNode = (XMLNode)(accountDetailsContXml.getElementsByTagName("PrimariesList").item(0).getFirstChild());
211 primaryElement = (XMLElement)primaryNode;
212 agreementDetailsContNode = (XMLNode)(accountDetailsContXml.getElementsByTagName("AgreementDetailsContList").item(0).getFirstChild());
213
214 }
215 catch(Exception e) {
216 }
217 }
218 }
219
220