View Javadoc
1   /*
2    * Copyright 2011 The Kuali Foundation.
3    * 
4    * Licensed under the Educational Community License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    * 
8    * http://www.opensource.org/licenses/ecl2.php
9    * 
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   */
16  package org.kuali.ole.select.service.impl;
17  
18  import org.kuali.ole.select.businessobject.BibInfoBean;
19  import org.xml.sax.Attributes;
20  import org.xml.sax.SAXException;
21  import org.xml.sax.helpers.DefaultHandler;
22  
23  import javax.xml.parsers.SAXParser;
24  import javax.xml.parsers.SAXParserFactory;
25  import java.io.ByteArrayInputStream;
26  import java.io.InputStream;
27  import java.util.ArrayList;
28  import java.util.List;
29  
30  public class BuildVendorBibInfoBean {
31      private static org.apache.log4j.Logger LOG = org.apache.log4j.Logger.getLogger(BuildVendorBibInfoBean.class);
32  
33      private BibInfoBean bibInfoBean;
34      StringBuilder stringBuilder = null;
35      String purchaseOrderType;
36      String requestorSourceType;
37      private List<BibInfoBean> bibInfoBeanList = null;
38  
39      public List<BibInfoBean> getBibInfoList(String xmlString) {
40          bibInfoBeanList = new ArrayList<BibInfoBean>();
41          try {
42              initiateDocument(xmlString);
43          } catch (Exception ex) {
44              LOG.error("parsing error in BuildVendorBibInfoBean " + ex);
45              throw new RuntimeException(ex);
46          }
47  
48          return bibInfoBeanList;
49      }
50  
51      private void initiateDocument(String xmlString) throws Exception {
52          
53        /*  if (path == null || path.length() == 0){
54              Properties properties = new Properties();
55              try {
56                  properties.load(new FileInputStream("org/kuali/ole/select/service/impl/bibinfo.properties"));
57                  path = properties.getProperty("filename");
58              } catch (IOException e) {
59              }
60          }*/
61  
62          SAXParserFactory factory = SAXParserFactory.newInstance();
63          SAXParser saxParser = factory.newSAXParser();
64  
65          DefaultHandler handler = new DefaultHandler() {
66  
67              boolean leader = false;
68              boolean controlField = false;
69  
70              boolean isbn = false;
71              boolean author = false;
72              boolean title = false;
73              boolean placeOfPublication = false;
74              boolean publisher = false;
75              boolean yearOfPublication = false;
76              boolean accountNumber = false;
77              boolean location = false;
78              boolean libraryNote = false;
79              boolean listPrice = false;
80              boolean quantity = false;
81              boolean ybp = false;
82              boolean subAccountNumber = false;
83              boolean binding = false;
84              boolean initials = false;
85              boolean dateOrdered = false;
86              boolean vendorCode = false;
87              boolean ybpuid = false;
88              boolean requisitionDescription = false;
89              boolean financialYear = false;
90              boolean fundingSource = false;
91              boolean deliveryCampusCode = false;
92              boolean deliverytoName = false;
93              boolean deliveryBuildingCode = false;
94              boolean deliveryBuildingLine1Address = false;
95              boolean deliveryBuildingRoomNumber = false;
96              boolean deliveryCityName = false;
97              boolean deliveryStateCode = false;
98              boolean deliveryPostalCode = false;
99              boolean deliveryCountryCode = false;
100             boolean vendorCustomerNumber = false;
101             //boolean items = false;
102             boolean purchaseOrderTransmissionMethodCode = false;
103             boolean purchaseOrderCostSourceCode = false;
104             boolean requestorPersonName = false;
105             boolean requestorPersonEmailAddress = false;
106             boolean requestorPersonPhoneNumber = false;
107             boolean volumeNumber = false;
108 
109             boolean uom = false;
110             boolean chart = false;
111             boolean objectCode = false;
112             boolean percent = false;
113             boolean chartOfAccountsCode = false;
114             boolean organizationCode = false;
115             boolean documentFundingSourceCode = false;
116             boolean useTaxIndicator = false;
117             boolean deliveryBuildingOtherIndicator = false;
118             boolean organizationAutomaticPurchaseOrderLimit = false;
119             boolean purchaseOrderAutomaticIndicator = false;
120             boolean receivingDocumentRequiredIndicator = false;
121             boolean paymentRequestPositiveApprovalIndicator = false;
122             boolean itemTypeCode = false;
123             boolean orderType = false;
124 
125             boolean billingName = false;
126             boolean billingLine1Address = false;
127             boolean billingCityName = false;
128             boolean billingStateCode = false;
129             boolean billingPostalCode = false;
130             boolean billingCountryCode = false;
131             boolean billingPhoneNumber = false;
132             boolean acquisitionunitvendoraccount = false;
133             // boolean requestorsource = false;
134 
135             public void startElement(String uri, String localName,
136                                      String qName, Attributes attributes) throws SAXException {
137                 if (LOG.isDebugEnabled())
138                     LOG.debug("<-------------------qName----------------------->" + qName);
139 
140                 if (qName.equalsIgnoreCase("REQUISITIONS")) {
141                     purchaseOrderType = attributes.getValue("ordertype");
142                     orderType = true;
143                     requestorSourceType = attributes.getValue("requestorsource");
144                 }
145                 if (qName.equalsIgnoreCase("REQUISITION")) {
146                     bibInfoBean = new BibInfoBean();
147                     orderType = true;
148                 } else if (qName.equalsIgnoreCase("LEADER")) {
149                     stringBuilder = new StringBuilder();
150                     leader = true;
151                 } else if (qName.equalsIgnoreCase("CONTROLFIELD")) {
152                     stringBuilder = new StringBuilder();
153                     controlField = true;
154                 } else if (qName.equalsIgnoreCase("ISBN")) {
155                     stringBuilder = new StringBuilder();
156                     isbn = true;
157                 } else if (qName.equalsIgnoreCase("AUTHOR")) {
158                     stringBuilder = new StringBuilder();
159                     author = true;
160                 } else if (qName.equalsIgnoreCase("TITLE")) {
161                     stringBuilder = new StringBuilder();
162                     title = true;
163                 } else if (qName.equalsIgnoreCase("PLACEOFPUBLICATION")) {
164                     stringBuilder = new StringBuilder();
165                     placeOfPublication = true;
166                 } else if (qName.equalsIgnoreCase("PUBLISHER")) {
167                     stringBuilder = new StringBuilder();
168                     publisher = true;
169                 } else if (qName.equalsIgnoreCase("YEAROFPUBLICATION")) {
170                     stringBuilder = new StringBuilder();
171                     yearOfPublication = true;
172                 } else if (qName.equalsIgnoreCase("ACCOUNTNO")) {
173                     stringBuilder = new StringBuilder();
174                     accountNumber = true;
175                 } else if (qName.equalsIgnoreCase("LOCATION")) {
176                     stringBuilder = new StringBuilder();
177                     location = true;
178                 } else if (qName.equalsIgnoreCase("LIBRARYNOTE")) {
179                     stringBuilder = new StringBuilder();
180                     libraryNote = true;
181                 } else if (qName.equalsIgnoreCase("LISTPRICE")) {
182                     stringBuilder = new StringBuilder();
183                     listPrice = true;
184                 } else if (qName.equalsIgnoreCase("QUANTITY")) {
185                     stringBuilder = new StringBuilder();
186                     quantity = true;
187                 } else if (qName.equalsIgnoreCase("YBP")) {
188                     stringBuilder = new StringBuilder();
189                     ybp = true;
190                 } else if (qName.equalsIgnoreCase("SUBACCOUNTNUMBER")) {
191                     stringBuilder = new StringBuilder();
192                     subAccountNumber = true;
193                 } else if (qName.equalsIgnoreCase("BINDING")) {
194                     stringBuilder = new StringBuilder();
195                     binding = true;
196                 } else if (qName.equalsIgnoreCase("INITIALS")) {
197                     stringBuilder = new StringBuilder();
198                     initials = true;
199                 } else if (qName.equalsIgnoreCase("DATEORDERED")) {
200                     stringBuilder = new StringBuilder();
201                     dateOrdered = true;
202                 } else if (qName.equalsIgnoreCase("VENDORCODE")) {
203                     stringBuilder = new StringBuilder();
204                     vendorCode = true;
205                 } else if (qName.equalsIgnoreCase("YBPUID")) {
206                     stringBuilder = new StringBuilder();
207                     ybpuid = true;
208                 } else if (qName.equalsIgnoreCase("REQUISITIONDESCRIPTION")) {
209                     stringBuilder = new StringBuilder();
210                     requisitionDescription = true;
211                 } else if (qName.equalsIgnoreCase("FINANCIALYEAR")) {
212                     stringBuilder = new StringBuilder();
213                     financialYear = true;
214                 } else if (qName.equalsIgnoreCase("FUNDINGSOURCE")) {
215                     stringBuilder = new StringBuilder();
216                     fundingSource = true;
217                 } else if (qName.equalsIgnoreCase("DELIVERYCAMPUSCODE")) {
218                     stringBuilder = new StringBuilder();
219                     deliveryCampusCode = true;
220                 } else if (qName.equalsIgnoreCase("DELIVERYTONAME")) {
221                     stringBuilder = new StringBuilder();
222                     deliverytoName = true;
223                 } else if (qName.equalsIgnoreCase("DELIVERYBUILDINGCODE")) {
224                     stringBuilder = new StringBuilder();
225                     deliveryBuildingCode = true;
226                 } else if (qName.equalsIgnoreCase("DELIVERYBUILDINGLINE1ADDRESS")) {
227                     stringBuilder = new StringBuilder();
228                     deliveryBuildingLine1Address = true;
229                 } else if (qName.equalsIgnoreCase("DELIVERYBUILDINGROOMNUMBER")) {
230                     stringBuilder = new StringBuilder();
231                     deliveryBuildingRoomNumber = true;
232                 } else if (qName.equalsIgnoreCase("DELIVERYCITYNAME")) {
233                     stringBuilder = new StringBuilder();
234                     deliveryCityName = true;
235                 } else if (qName.equalsIgnoreCase("DELIVERYSTATECODE")) {
236                     stringBuilder = new StringBuilder();
237                     deliveryStateCode = true;
238                 } else if (qName.equalsIgnoreCase("DELIVERYPOSTALCODE")) {
239                     stringBuilder = new StringBuilder();
240                     deliveryPostalCode = true;
241                 } else if (qName.equalsIgnoreCase("DELIVERYCOUNTRYCODE")) {
242                     stringBuilder = new StringBuilder();
243                     deliveryCountryCode = true;
244                 } else if (qName.equalsIgnoreCase("VENDORCUSTOMERNUMBER")) {
245                     stringBuilder = new StringBuilder();
246                     vendorCustomerNumber = true;
247                 } else if (qName.equalsIgnoreCase("PURCHASEORDERTRANSMISSIONMETHODCODE")) {
248                     stringBuilder = new StringBuilder();
249                     purchaseOrderTransmissionMethodCode = true;
250                 } else if (qName.equalsIgnoreCase("PURCHASEORDERCOSTSOURCECODE")) {
251                     stringBuilder = new StringBuilder();
252                     purchaseOrderCostSourceCode = true;
253                 } else if (qName.equalsIgnoreCase("REQUESTORPERSONNAME")) {
254                     stringBuilder = new StringBuilder();
255                     requestorPersonName = true;
256                 } else if (qName.equalsIgnoreCase("REQUESTORPERSONEMAILADDRESS")) {
257                     stringBuilder = new StringBuilder();
258                     requestorPersonEmailAddress = true;
259                 } else if (qName.equalsIgnoreCase("REQUESTORPERSONPHONENUMBER")) {
260                     stringBuilder = new StringBuilder();
261                     requestorPersonPhoneNumber = true;
262                 } else if (qName.equalsIgnoreCase("VOLUMENUMBER")) {
263                     stringBuilder = new StringBuilder();
264                     volumeNumber = true;
265                 } else if (qName.equalsIgnoreCase("UOM")) {
266                     stringBuilder = new StringBuilder();
267                     uom = true;
268                 } else if (qName.equalsIgnoreCase("CHART")) {
269                     stringBuilder = new StringBuilder();
270                     chart = true;
271                 } else if (qName.equalsIgnoreCase("OBJECTCODE")) {
272                     stringBuilder = new StringBuilder();
273                     objectCode = true;
274                 } else if (qName.equalsIgnoreCase("PERCENT")) {
275                     stringBuilder = new StringBuilder();
276                     percent = true;
277                 } else if (qName.equalsIgnoreCase("CHARTOFACCOUNTSCODE")) {
278                     stringBuilder = new StringBuilder();
279                     chartOfAccountsCode = true;
280                 } else if (qName.equalsIgnoreCase("ORGANIZATIONCODE")) {
281                     stringBuilder = new StringBuilder();
282                     organizationCode = true;
283                 } else if (qName.equalsIgnoreCase("DOCUMENTFUNDINGSOURCECODE")) {
284                     stringBuilder = new StringBuilder();
285                     documentFundingSourceCode = true;
286                 } else if (qName.equalsIgnoreCase("USETAXINDICATOR")) {
287                     stringBuilder = new StringBuilder();
288                     useTaxIndicator = true;
289                 } else if (qName.equalsIgnoreCase("DELIVERYBUILDINGOTHERINDICATOR")) {
290                     stringBuilder = new StringBuilder();
291                     deliveryBuildingOtherIndicator = true;
292                 } else if (qName.equalsIgnoreCase("ORGANIZATIONAUTOMATICPURCHASEORDERLIMIT")) {
293                     stringBuilder = new StringBuilder();
294                     organizationAutomaticPurchaseOrderLimit = true;
295                 } else if (qName.equalsIgnoreCase("PURCHASEORDERAUTOMATICINDICATOR")) {
296                     stringBuilder = new StringBuilder();
297                     purchaseOrderAutomaticIndicator = true;
298                 } else if (qName.equalsIgnoreCase("RECEIVINGDOCUMENTREQUIREDINDICATOR")) {
299                     stringBuilder = new StringBuilder();
300                     receivingDocumentRequiredIndicator = true;
301                 } else if (qName.equalsIgnoreCase("PAYMENTREQUESTPOSITIVEAPPROVALINDICATOR")) {
302                     stringBuilder = new StringBuilder();
303                     paymentRequestPositiveApprovalIndicator = true;
304                 } else if (qName.equalsIgnoreCase("ITEMTYPECODE")) {
305                     stringBuilder = new StringBuilder();
306                     itemTypeCode = true;
307                 } else if (qName.equalsIgnoreCase("BILLINGNAME")) {
308                     stringBuilder = new StringBuilder();
309                     LOG.debug("----------Bill----Name----->true");
310                     billingName = true;
311                 } else if (qName.equalsIgnoreCase("BILLINGLINE1ADDRESS")) {
312                     stringBuilder = new StringBuilder();
313                     billingLine1Address = true;
314                 } else if (qName.equalsIgnoreCase("BILLINGCITYNAME")) {
315                     stringBuilder = new StringBuilder();
316                     billingCityName = true;
317                 } else if (qName.equalsIgnoreCase("BILLINGSTATECODE")) {
318                     stringBuilder = new StringBuilder();
319                     billingStateCode = true;
320                 } else if (qName.equalsIgnoreCase("BILLINGPOSTALCODE")) {
321                     stringBuilder = new StringBuilder();
322                     billingPostalCode = true;
323                 } else if (qName.equalsIgnoreCase("BILLINGCOUNTRYCODE")) {
324                     stringBuilder = new StringBuilder();
325                     billingCountryCode = true;
326                 } else if (qName.equalsIgnoreCase("BILLINGPHONENUMBER")) {
327                     stringBuilder = new StringBuilder();
328                     billingPhoneNumber = true;
329                 } else if (qName.equalsIgnoreCase("ACQUISITIONUNITVENDORACCOUNT")) {
330                     stringBuilder = new StringBuilder();
331                     acquisitionunitvendoraccount = true;
332                 }
333 
334 
335             }
336 
337             public void endElement(String uri, String localName,
338                                    String qName) throws SAXException {
339 
340                 if (leader) {
341                     bibInfoBean.setLeader(stringBuilder.toString());
342                     stringBuilder = null;
343                     leader = false;
344                 } else if (controlField) {
345                     bibInfoBean.setControlField(stringBuilder.toString());
346                     stringBuilder = null;
347                     controlField = false;
348                 } else if (isbn) {
349                     bibInfoBean.setIsbn(stringBuilder.toString());
350                     bibInfoBean.setStandardNumber(stringBuilder.toString());
351                     stringBuilder = null;
352                     isbn = false;
353                 } else if (author) {
354                     bibInfoBean.setAuthor(stringBuilder.toString());
355                     stringBuilder = null;
356                     author = false;
357                 } else if (title) {
358                     bibInfoBean.setTitle(stringBuilder.toString());
359                     stringBuilder = null;
360                     title = false;
361                 } else if (placeOfPublication) {
362                     bibInfoBean.setPlaceOfPublication(stringBuilder.toString());
363                     stringBuilder = null;
364                     placeOfPublication = false;
365                 } else if (publisher) {
366                     bibInfoBean.setPublisher(stringBuilder.toString());
367                     stringBuilder = null;
368                     publisher = false;
369                 } else if (yearOfPublication) {
370                     bibInfoBean.setYearOfPublication(stringBuilder.toString());
371                     stringBuilder = null;
372                     yearOfPublication = false;
373                 } else if (accountNumber) {
374                     bibInfoBean.setAccountNumber(stringBuilder.toString());
375                     if (LOG.isDebugEnabled())
376                         LOG.debug("Account No==>" + stringBuilder.toString());
377                     stringBuilder = null;
378                     accountNumber = false;
379                 } else if (location) {
380                     bibInfoBean.setLocation(stringBuilder.toString());
381                     stringBuilder = null;
382                     location = false;
383                 } else if (libraryNote) {
384                     bibInfoBean.setLibrarynote(stringBuilder.toString());
385                     stringBuilder = null;
386                     libraryNote = false;
387                 } else if (listPrice) {
388                     if (stringBuilder.toString().length() > 0) {
389                         bibInfoBean.setListprice(new Double(stringBuilder.toString()));
390                         listPrice = false;
391                     }
392                     stringBuilder = null;
393                 } else if (quantity) {
394                     if (stringBuilder.toString().length() > 0) {
395                         bibInfoBean.setQuantity(new Long(stringBuilder.toString()));
396                         quantity = false;
397                     }
398                     stringBuilder = null;
399                 } else if (ybp) {
400                     bibInfoBean.setYbp(stringBuilder.toString());
401                     stringBuilder = null;
402                     ybp = false;
403                 } else if (subAccountNumber) {
404                     bibInfoBean.setSubAccountNumber(stringBuilder.toString());
405                     stringBuilder = null;
406                     subAccountNumber = false;
407                 } else if (binding) {
408                     bibInfoBean.setBinding(stringBuilder.toString());
409                     stringBuilder = null;
410                     binding = false;
411                 } else if (initials) {
412                     bibInfoBean.setInitials(stringBuilder.toString());
413                     stringBuilder = null;
414                     initials = false;
415                 } else if (dateOrdered) {
416                     bibInfoBean.setDateOrdered(stringBuilder.toString());
417                     stringBuilder = null;
418                     dateOrdered = false;
419                 } else if (vendorCode) {
420                     bibInfoBean.setVendorCode(stringBuilder.toString());
421                     stringBuilder = null;
422                     vendorCode = false;
423                 } else if (ybpuid) {
424                     bibInfoBean.setYbpuid(stringBuilder.toString());
425                     stringBuilder = null;
426                     ybpuid = false;
427                 } else if (requisitionDescription) {
428                     bibInfoBean.setRequisitionDescription(stringBuilder.toString());
429                     stringBuilder = null;
430                     requisitionDescription = false;
431                 } else if (financialYear) {
432                     bibInfoBean.setFinantialYear(stringBuilder.toString());
433                     stringBuilder = null;
434                     financialYear = false;
435                 } else if (fundingSource) {
436                     bibInfoBean.setFundingSource(stringBuilder.toString());
437                     stringBuilder = null;
438                     fundingSource = false;
439                 } else if (deliveryCampusCode) {
440                     bibInfoBean.setDeliveryCampusCode(stringBuilder.toString());
441                     stringBuilder = null;
442                     deliveryCampusCode = false;
443                 } else if (deliverytoName) {
444                     bibInfoBean.setDeliveryToName(stringBuilder.toString());
445                     stringBuilder = null;
446                     deliverytoName = false;
447                 } else if (deliveryBuildingCode) {
448                     bibInfoBean.setDeliveryBuildingCode(stringBuilder.toString());
449                     stringBuilder = null;
450                     deliveryBuildingCode = false;
451                 } else if (deliveryBuildingLine1Address) {
452                     bibInfoBean.setDeliveryBuildingLine1Address(stringBuilder.toString());
453                     stringBuilder = null;
454                     deliveryBuildingLine1Address = false;
455                 } else if (deliveryBuildingRoomNumber) {
456                     bibInfoBean.setDeliveryBuildingRoomNumber(stringBuilder.toString());
457                     stringBuilder = null;
458                     deliveryBuildingRoomNumber = false;
459                 } else if (deliveryCityName) {
460                     bibInfoBean.setDeliveryCityName(stringBuilder.toString());
461                     stringBuilder = null;
462                     deliveryCityName = false;
463                 } else if (deliveryStateCode) {
464                     bibInfoBean.setDeliveryStateCode(stringBuilder.toString());
465                     stringBuilder = null;
466                     deliveryStateCode = false;
467                 } else if (deliveryPostalCode) {
468                     bibInfoBean.setDeliveryPostalCode(stringBuilder.toString());
469                     stringBuilder = null;
470                     deliveryPostalCode = false;
471                 } else if (deliveryCountryCode) {
472                     bibInfoBean.setDeliveryCountryCode(stringBuilder.toString());
473                     stringBuilder = null;
474                     deliveryCountryCode = false;
475                 } else if (vendorCustomerNumber) {
476                     bibInfoBean.setVendorCustomerNumber(stringBuilder.toString());
477                     stringBuilder = null;
478                     vendorCustomerNumber = false;
479                 } else if (purchaseOrderTransmissionMethodCode) {
480                     bibInfoBean.setPurchaseOrderTransmissionMethodCode(stringBuilder.toString());
481                     stringBuilder = null;
482                     purchaseOrderTransmissionMethodCode = false;
483                 } else if (purchaseOrderCostSourceCode) {
484                     bibInfoBean.setPurchaseOrderCostSourceCode(stringBuilder.toString());
485                     stringBuilder = null;
486                     purchaseOrderCostSourceCode = false;
487                 } else if (requestorPersonName) {
488                     bibInfoBean.setRequestorPersonName(stringBuilder.toString());
489                     stringBuilder = null;
490                     requestorPersonName = false;
491                 } else if (requestorPersonEmailAddress) {
492                     bibInfoBean.setRequestorPersonEmailAddress(stringBuilder.toString());
493                     stringBuilder = null;
494                     requestorPersonEmailAddress = false;
495                 } else if (requestorPersonPhoneNumber) {
496                     bibInfoBean.setRequestorPersonPhoneNumber(stringBuilder.toString());
497                     stringBuilder = null;
498                     requestorPersonPhoneNumber = false;
499                 } else if (volumeNumber) {
500                     bibInfoBean.setVolumeNumber(stringBuilder.toString());
501                     stringBuilder = null;
502                     volumeNumber = false;
503                 } else if (uom) {
504                     bibInfoBean.setUom(stringBuilder.toString());
505                     stringBuilder = null;
506                     uom = false;
507                 } else if (chart) {
508                     bibInfoBean.setChart(stringBuilder.toString());
509                     stringBuilder = null;
510                     chart = false;
511                 } else if (objectCode) {
512                     bibInfoBean.setObjectCode(stringBuilder.toString());
513                     stringBuilder = null;
514                     objectCode = false;
515                 } else if (percent) {
516                     if (stringBuilder.toString().length() > 0) {
517                         bibInfoBean.setPercent(new Long(stringBuilder.toString()));
518                         percent = false;
519                     }
520                     stringBuilder = null;
521                 } else if (chartOfAccountsCode) {
522                     bibInfoBean.setChartOfAccountsCode(stringBuilder.toString());
523                     stringBuilder = null;
524                     chartOfAccountsCode = false;
525                 } else if (organizationCode) {
526                     bibInfoBean.setOrganizationCode(stringBuilder.toString());
527                     stringBuilder = null;
528                     organizationCode = false;
529                 } else if (documentFundingSourceCode) {
530                     bibInfoBean.setDocumentFundingSourceCode(stringBuilder.toString());
531                     stringBuilder = null;
532                     documentFundingSourceCode = false;
533                 } else if (useTaxIndicator) {
534                     bibInfoBean.setUseTaxIndicator(stringBuilder.toString().equalsIgnoreCase("TRUE") ? true : false);
535                     stringBuilder = null;
536                     useTaxIndicator = false;
537                 } else if (deliveryBuildingOtherIndicator) {
538                     bibInfoBean.setDeliveryBuildingOtherIndicator(stringBuilder.toString().equalsIgnoreCase("TRUE") ? true : false);
539                     stringBuilder = null;
540                     deliveryBuildingOtherIndicator = false;
541                 } else if (organizationAutomaticPurchaseOrderLimit) {
542                     bibInfoBean.setOrganizationAutomaticPurchaseOrderLimit(stringBuilder.toString());
543                     stringBuilder = null;
544                     organizationAutomaticPurchaseOrderLimit = false;
545                 } else if (purchaseOrderAutomaticIndicator) {
546                     bibInfoBean.setPurchaseOrderAutomaticIndicator(stringBuilder.toString().equalsIgnoreCase("TRUE") ? true : false);
547                     stringBuilder = null;
548                     purchaseOrderAutomaticIndicator = false;
549                 } else if (receivingDocumentRequiredIndicator) {
550                     bibInfoBean.setReceivingDocumentRequiredIndicator(stringBuilder.toString().equalsIgnoreCase("TRUE") ? true : false);
551                     stringBuilder = null;
552                     receivingDocumentRequiredIndicator = false;
553                 } else if (paymentRequestPositiveApprovalIndicator) {
554                     bibInfoBean.setPaymentRequestPositiveApprovalIndicator(stringBuilder.toString().equalsIgnoreCase("TRUE") ? true : false);
555                     stringBuilder = null;
556                     paymentRequestPositiveApprovalIndicator = false;
557                 } else if (itemTypeCode) {
558                     bibInfoBean.setItemTypeCode(stringBuilder.toString());
559                     stringBuilder = null;
560                     itemTypeCode = false;
561                 } else if (billingName) {
562                     bibInfoBean.setBillingName(stringBuilder.toString());
563                     if (LOG.isDebugEnabled()) {
564                         LOG.debug("------------------Billing Name-----stringBuilder.toString()--------" + stringBuilder.toString());
565                         LOG.debug("------------------Billing Name-------------" + bibInfoBean.getBillingName());
566                     }
567                     stringBuilder = null;
568                     billingName = false;
569                 } else if (billingLine1Address) {
570                     bibInfoBean.setBillingLine1Address(stringBuilder.toString());
571                     stringBuilder = null;
572                     billingLine1Address = false;
573                 } else if (billingCityName) {
574                     bibInfoBean.setBillingCityName(stringBuilder.toString());
575                     stringBuilder = null;
576                     billingCityName = false;
577                 } else if (billingStateCode) {
578                     bibInfoBean.setBillingStateCode(stringBuilder.toString());
579                     stringBuilder = null;
580                     billingStateCode = false;
581                 } else if (billingPostalCode) {
582                     bibInfoBean.setBillingPostalCode(stringBuilder.toString());
583                     stringBuilder = null;
584                     billingPostalCode = false;
585                 } else if (billingCountryCode) {
586                     bibInfoBean.setBillingCountryCode(stringBuilder.toString());
587                     stringBuilder = null;
588                     billingCountryCode = false;
589                 } else if (billingPhoneNumber) {
590                     bibInfoBean.setBillingPhoneNumber(stringBuilder.toString());
591                     stringBuilder = null;
592                     billingPhoneNumber = false;
593                 } else if (acquisitionunitvendoraccount) {
594                     bibInfoBean.setVendorCustomerNumber(stringBuilder.toString());
595                     stringBuilder = null;
596                     acquisitionunitvendoraccount = false;
597                 } else if (qName.equalsIgnoreCase("REQUISITION")) {
598                     bibInfoBean.setPurchaseOrderType(purchaseOrderType);
599                     bibInfoBean.setRequisitionSource(requestorSourceType);
600                     bibInfoBeanList.add(bibInfoBean);
601                     stringBuilder = null;
602                 }
603 
604             }
605 
606             public void characters(char ch[], int start, int length)
607                     throws SAXException {
608                 if (stringBuilder != null)
609                     stringBuilder.append(ch, start, length);
610             }
611 
612         };
613         InputStream is = new ByteArrayInputStream(xmlString.getBytes("UTF-8"));
614         saxParser.parse(is, handler);
615     }
616 }
617