001: /*
002: * Copyright 2007 The Kuali Foundation.
003: *
004: * Licensed under the Educational Community License, Version 1.0 (the "License");
005: * you may not use this file except in compliance with the License.
006: * You may obtain a copy of the License at
007: *
008: * http://www.opensource.org/licenses/ecl1.php
009: *
010: * Unless required by applicable law or agreed to in writing, software
011: * distributed under the License is distributed on an "AS IS" BASIS,
012: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013: * See the License for the specific language governing permissions and
014: * limitations under the License.
015: */
016: /*
017: * Created on Sep 27, 2004
018: *
019: */
020: package org.kuali.module.pdp.xml;
021:
022: import java.io.Serializable;
023: import java.sql.Timestamp;
024: import java.text.ParseException;
025: import java.text.SimpleDateFormat;
026: import java.util.ArrayList;
027: import java.util.Date;
028: import java.util.List;
029: import java.util.Locale;
030:
031: import org.kuali.module.pdp.bo.PaymentGroup;
032:
033: /**
034: * @author jsissom
035: */
036: public class XmlGroup implements Serializable {
037: private static org.apache.log4j.Logger LOG = org.apache.log4j.Logger
038: .getLogger(XmlGroup.class);
039:
040: private String payee_name = null;
041: private String id_type = null;
042: private String payee_id = null;
043: private String payee_own_cd = null;
044: private String customer_institution_identifier = null;
045: private String address1 = null;
046: private String address2 = null;
047: private String address3 = null;
048: private String address4 = null;
049: private String city = null;
050: private String state = null;
051: private String country = null;
052: private String zip = null;
053: private Boolean campus_address_ind = null;
054: private Date payment_date = null;
055: private Boolean attachment_ind = null;
056: private Boolean special_handling_ind = null;
057: private Boolean taxable_ind = null;
058: private Boolean nra_ind = null;
059: private Boolean immediate_ind = Boolean.FALSE;
060: private Boolean combine_ind = null;
061: private List detail;
062:
063: public XmlGroup() {
064: detail = new ArrayList();
065: }
066:
067: public List getDetail() {
068: return detail;
069: }
070:
071: public void setDetail(List detail) {
072: this .detail = detail;
073: }
074:
075: public void addDetail(XmlDetail d) {
076: this .detail.add(d);
077: }
078:
079: public Boolean getAttachment_ind() {
080: return attachment_ind;
081: }
082:
083: public Boolean getCampus_address_ind() {
084: return campus_address_ind;
085: }
086:
087: public Boolean getNra_ind() {
088: return nra_ind;
089: }
090:
091: public Boolean getImmediate_ind() {
092: return immediate_ind;
093: }
094:
095: public Boolean getSpecial_handling_ind() {
096: return special_handling_ind;
097: }
098:
099: public Boolean getTaxable_ind() {
100: return taxable_ind;
101: }
102:
103: public void setField(String name, String value) {
104: // Don't need to set an empty value
105: if ((value == null) || (value.length() == 0)) {
106: return;
107: }
108:
109: if ("payee_name".equals(name)) {
110: setPayee_name(value);
111: } else if ("id_type".equals(name)) {
112: setId_type(value);
113: } else if ("payee_id".equals(name)) {
114: setPayee_id(value);
115: } else if ("payee_own_cd".equals(name)) {
116: setPayee_own_cd(value);
117: } else if ("customer_institution_identifier".equals(name)) {
118: setCustomerInstitutionIdentifier(value);
119: } else if ("address1".equals(name)) {
120: setAddress1(value);
121: } else if ("address2".equals(name)) {
122: setAddress2(value);
123: } else if ("address3".equals(name)) {
124: setAddress3(value);
125: } else if ("address4".equals(name)) {
126: setAddress4(value);
127: } else if ("city".equals(name)) {
128: setCity(value);
129: } else if ("state".equals(name)) {
130: setState(value);
131: } else if ("country".equals(name)) {
132: setCountry(value);
133: } else if ("zip".equals(name)) {
134: setZip(value);
135: } else if ("campus_address_ind".equals(name)) {
136: setCampus_address_ind(new Boolean(value.equals("Y")));
137: } else if ("payment_date".equals(name)) {
138: try {
139: SimpleDateFormat sdf = new SimpleDateFormat(
140: "yyyy-MM-dd", Locale.US);
141: setPayment_date(sdf.parse(value));
142: } catch (ParseException e) {
143: // Don't know what to do
144: }
145: } else if ("attachment_ind".equals(name)) {
146: setAttachment_ind(new Boolean(value.equals("Y")));
147: } else if ("special_handling_ind".equals(name)) {
148: setSpecial_handling_ind(new Boolean(value.equals("Y")));
149: } else if ("taxable_ind".equals(name)) {
150: setTaxable_ind(new Boolean(value.equals("Y")));
151: } else if ("nra_ind".equals(name)) {
152: setNra_ind(new Boolean(value.equals("Y")));
153: } else if ("immediate_ind".equals(name)) {
154: setImmediate_ind(new Boolean(value.equals("Y")));
155: } else if ("combine_group_ind".equals(name)) {
156: setCombine_ind(new Boolean(value.equals("Y")));
157: }
158: }
159:
160: public PaymentGroup getPaymentGroup() {
161: PaymentGroup d = new PaymentGroup();
162:
163: d.setPayeeName(payee_name);
164: d.setPayeeIdTypeCd(id_type);
165: d.setPayeeId(payee_id);
166: d.setPayeeOwnerCd(payee_own_cd);
167: d.setCustomerInstitutionNumber(customer_institution_identifier);
168: d.setLine1Address(address1);
169: d.setLine2Address(address2);
170: d.setLine3Address(address3);
171: d.setLine4Address(address4);
172: d.setCity(city);
173: d.setState(state);
174: d.setCountry(country);
175: d.setZipCd(zip);
176: d.setCampusAddress(campus_address_ind);
177: if (payment_date != null) {
178: d.setPaymentDate(new Timestamp(payment_date.getTime()));
179: } else {
180: d.setPaymentDate(null);
181: }
182: d.setPymtAttachment(attachment_ind);
183: d.setPymtSpecialHandling(special_handling_ind);
184: d.setTaxablePayment(taxable_ind);
185: d.setNraPayment(nra_ind);
186: d.setProcessImmediate(immediate_ind);
187: d.setCombineGroups(combine_ind);
188: return d;
189: }
190:
191: public Boolean getCombine_ind() {
192: return combine_ind;
193: }
194:
195: public void setCombine_ind(Boolean combine_ind) {
196: this .combine_ind = combine_ind;
197: }
198:
199: /**
200: * @return Returns the city.
201: */
202: public String getCity() {
203: return city;
204: }
205:
206: /**
207: * @param city The city to set.
208: */
209: public void setCity(String city) {
210: this .city = city;
211: }
212:
213: /**
214: * @return Returns the country.
215: */
216: public String getCountry() {
217: return country;
218: }
219:
220: /**
221: * @param country The country to set.
222: */
223: public void setCountry(String country) {
224: this .country = country;
225: }
226:
227: /**
228: * @return Returns the state.
229: */
230: public String getState() {
231: return state;
232: }
233:
234: /**
235: * @param state The state to set.
236: */
237: public void setState(String state) {
238: this .state = state;
239: }
240:
241: /**
242: * @return Returns the address1.
243: */
244: public String getAddress1() {
245: return address1;
246: }
247:
248: /**
249: * @param address1 The address1 to set.
250: */
251: public void setAddress1(String address1) {
252: this .address1 = address1;
253: }
254:
255: /**
256: * @return Returns the address2.
257: */
258: public String getAddress2() {
259: return address2;
260: }
261:
262: /**
263: * @param address2 The address2 to set.
264: */
265: public void setAddress2(String address2) {
266: this .address2 = address2;
267: }
268:
269: /**
270: * @return Returns the address3.
271: */
272: public String getAddress3() {
273: return address3;
274: }
275:
276: /**
277: * @param address3 The address3 to set.
278: */
279: public void setAddress3(String address3) {
280: this .address3 = address3;
281: }
282:
283: /**
284: * @return Returns the address4.
285: */
286: public String getAddress4() {
287: return address4;
288: }
289:
290: /**
291: * @param address4 The address4 to set.
292: */
293: public void setAddress4(String address4) {
294: this .address4 = address4;
295: }
296:
297: /**
298: * @return Returns the attachment_ind.
299: */
300: public Boolean isAttachment_ind() {
301: return attachment_ind;
302: }
303:
304: /**
305: * @param attachment_ind The attachment_ind to set.
306: */
307: public void setAttachment_ind(Boolean attachment_ind) {
308: this .attachment_ind = attachment_ind;
309: }
310:
311: /**
312: * @return Returns the campus_address_ind.
313: */
314: public Boolean isCampus_address_ind() {
315: return campus_address_ind;
316: }
317:
318: /**
319: * @param campus_address_ind The campus_address_ind to set.
320: */
321: public void setCampus_address_ind(Boolean campus_address_ind) {
322: this .campus_address_ind = campus_address_ind;
323: }
324:
325: public String getCustomer_institution_identifier() {
326: return customer_institution_identifier;
327: }
328:
329: public void setCustomerInstitutionIdentifier(
330: String customer_IU_identifier) {
331: this .customer_institution_identifier = customer_IU_identifier;
332: }
333:
334: /**
335: * @return Returns the id_type.
336: */
337: public String getId_type() {
338: return id_type;
339: }
340:
341: /**
342: * @param id_type The id_type to set.
343: */
344: public void setId_type(String id_type) {
345: this .id_type = id_type;
346: }
347:
348: /**
349: * @return Returns the nra_ind.
350: */
351: public Boolean isNra_ind() {
352: return nra_ind;
353: }
354:
355: /**
356: * @param nra_ind The nra_ind to set.
357: */
358: public void setNra_ind(Boolean nra_ind) {
359: this .nra_ind = nra_ind;
360: }
361:
362: /**
363: * @return Returns the immediate_ind.
364: */
365: public Boolean isImmediate_ind() {
366: return immediate_ind;
367: }
368:
369: /**
370: * @param immediate_ind The immediate_ind to set.
371: */
372: public void setImmediate_ind(Boolean immediate_ind) {
373: this .immediate_ind = immediate_ind;
374: }
375:
376: /**
377: * @return Returns the payee_id.
378: */
379: public String getPayee_id() {
380: return payee_id;
381: }
382:
383: /**
384: * @param payee_id The payee_id to set.
385: */
386: public void setPayee_id(String payee_id) {
387: this .payee_id = payee_id;
388: }
389:
390: /**
391: * @return Returns the payee_name.
392: */
393: public String getPayee_name() {
394: return payee_name;
395: }
396:
397: /**
398: * @param payee_name The payee_name to set.
399: */
400: public void setPayee_name(String payee_name) {
401: this .payee_name = payee_name;
402: }
403:
404: /**
405: * @return Returns the payee_own_cd.
406: */
407: public String getPayee_own_cd() {
408: return payee_own_cd;
409: }
410:
411: /**
412: * @param payee_own_cd The payee_own_cd to set.
413: */
414: public void setPayee_own_cd(String payee_own_cd) {
415: this .payee_own_cd = payee_own_cd;
416: }
417:
418: /**
419: * @return Returns the payment_date.
420: */
421: public Date getPayment_date() {
422: return payment_date;
423: }
424:
425: /**
426: * @param payment_date The payment_date to set.
427: */
428: public void setPayment_date(Date payment_date) {
429: this .payment_date = payment_date;
430: }
431:
432: /**
433: * @return Returns the special_handling_ind.
434: */
435: public Boolean isSpecial_handling_ind() {
436: return special_handling_ind;
437: }
438:
439: /**
440: * @param special_handling_ind The special_handling_ind to set.
441: */
442: public void setSpecial_handling_ind(Boolean special_handling_ind) {
443: this .special_handling_ind = special_handling_ind;
444: }
445:
446: /**
447: * @return Returns the taxable_ind.
448: */
449: public Boolean isTaxable_ind() {
450: return taxable_ind;
451: }
452:
453: /**
454: * @param taxable_ind The taxable_ind to set.
455: */
456: public void setTaxable_ind(Boolean taxable_ind) {
457: this .taxable_ind = taxable_ind;
458: }
459:
460: /**
461: * @return Returns the zip.
462: */
463: public String getZip() {
464: return zip;
465: }
466:
467: /**
468: * @param zip The zip to set.
469: */
470: public void setZip(String zip) {
471: this.zip = zip;
472: }
473: }
|