package cpm.com.gskmtorange.xmlHandlers;

import org.xmlpull.v1.XmlPullParser;
import org.xmlpull.v1.XmlPullParserException;

import java.io.IOException;

import cpm.com.gskmtorange.xmlGetterSetter.ADDITIONAL_DISPLAY_MASTERGetterSetter;
import cpm.com.gskmtorange.xmlGetterSetter.AdditionalQuestiongetterSetter;
import cpm.com.gskmtorange.xmlGetterSetter.BrandMasterGetterSetter;
import cpm.com.gskmtorange.xmlGetterSetter.CategoryMasterGetterSetter;
import cpm.com.gskmtorange.xmlGetterSetter.ChatMessageDownloadGetterSetter;
import cpm.com.gskmtorange.xmlGetterSetter.ConfigurationContrywiseGetterSetter;
import cpm.com.gskmtorange.xmlGetterSetter.ConfigurationMasterGetterSetter;
import cpm.com.gskmtorange.xmlGetterSetter.DisplayChecklistMasterGetterSetter;
import cpm.com.gskmtorange.xmlGetterSetter.DisplayMasterGetterSetter;
import cpm.com.gskmtorange.xmlGetterSetter.FailureGetterSetter;
import cpm.com.gskmtorange.xmlGetterSetter.GeoFencingGetterSetter;
import cpm.com.gskmtorange.xmlGetterSetter.JourneyPlanGetterSetter;
import cpm.com.gskmtorange.xmlGetterSetter.LoginGetterSetter;
import cpm.com.gskmtorange.xmlGetterSetter.MAPPINGT2PGetterSetter;
import cpm.com.gskmtorange.xmlGetterSetter.MAPPING_ADDITIONAL_PROMOTION_MasterGetterSetter;
import cpm.com.gskmtorange.xmlGetterSetter.MAPPING_PLANOGRAM_MasterGetterSetter;
import cpm.com.gskmtorange.xmlGetterSetter.MAPPING_SOS_TARGET_MasterGetterSetter;
import cpm.com.gskmtorange.xmlGetterSetter.MappingCategoryImageAllowGetterSetter;
import cpm.com.gskmtorange.xmlGetterSetter.MappingDisplayChecklistGetterSetter;
import cpm.com.gskmtorange.xmlGetterSetter.MappingPlanogramCountrywiseGetterSetter;
import cpm.com.gskmtorange.xmlGetterSetter.MappingPromotionGetterSetter;
import cpm.com.gskmtorange.xmlGetterSetter.MappingStockGetterSetter;
import cpm.com.gskmtorange.xmlGetterSetter.MappingStockStorewiseGetterSetter;
import cpm.com.gskmtorange.xmlGetterSetter.MappingSubCategoryImageAllowGetterSetter;
import cpm.com.gskmtorange.xmlGetterSetter.NoCameraDataGetterSetter;
import cpm.com.gskmtorange.xmlGetterSetter.NoCameraLastVisitGetterSetter;
import cpm.com.gskmtorange.xmlGetterSetter.NonT2pReasonGetterSetter;
import cpm.com.gskmtorange.xmlGetterSetter.NonWorkingReasonGetterSetter;
import cpm.com.gskmtorange.xmlGetterSetter.NonWorkingSubReasonGetterSetter;
import cpm.com.gskmtorange.xmlGetterSetter.POGQuestionGetterSetter;
import cpm.com.gskmtorange.xmlGetterSetter.STORE_PERFORMANCE_MasterGetterSetter;
import cpm.com.gskmtorange.xmlGetterSetter.ShelfMasterGetterSetter;
import cpm.com.gskmtorange.xmlGetterSetter.SkuGroupMasterGetterSetter;
import cpm.com.gskmtorange.xmlGetterSetter.SkuMasterGetterSetter;
import cpm.com.gskmtorange.xmlGetterSetter.SubCategoryMasterGetterSetter;
import cpm.com.gskmtorange.xmlGetterSetter.SupervisorListGetterSetter;

/**
 * Created by yadavendras on 21-12-2016.
 */

public class XMLHandlers {


    // FAILURE XML HANDLER
    public static FailureGetterSetter failureXMLHandler(XmlPullParser xpp,
                                                        int eventType) {
        FailureGetterSetter failureGetterSetter = new FailureGetterSetter();

        try {
            while (xpp.getEventType() != XmlPullParser.END_DOCUMENT) {
                if (xpp.getEventType() == XmlPullParser.START_TAG) {
                    if (xpp.getName().equals("STATUS")) {
                        failureGetterSetter.setStatus(xpp.nextText());
                    }
                    if (xpp.getName().equals("ERRORMSG")) {
                        failureGetterSetter.setErrorMsg(xpp.nextText());
                    }

                }
                xpp.next();
            }
        } catch (XmlPullParserException e) {

            e.printStackTrace();
        } catch (IOException e) {

            e.printStackTrace();
        }
        return failureGetterSetter;
    }

    // LOGIN XML HANDLER
    public static LoginGetterSetter loginXMLHandler(XmlPullParser xpp,
                                                    int eventType) {
        LoginGetterSetter lgs = new LoginGetterSetter();

        try {
            while (xpp.getEventType() != XmlPullParser.END_DOCUMENT) {
                if (xpp.getEventType() == XmlPullParser.START_TAG) {
                    if (xpp.getName().equals("RIGHT_NAME")) {
                        lgs.setRIGHT_NAME(xpp.nextText());
                    }
                    if (xpp.getName().equals("APP_VERSION")) {
                        lgs.setAPP_VERSION(xpp.nextText());
                    }
                    if (xpp.getName().equals("APP_PATH")) {
                        lgs.setAPP_PATH(xpp.nextText());
                    }
                    if (xpp.getName().equals("CURRENTDATE")) {
                        lgs.setCURRENTDATE(xpp.nextText());
                    }
                    if (xpp.getName().equals("CULTURE_ID")) {
                        lgs.setCULTURE_ID(xpp.nextText());
                    }
                    if (xpp.getName().equals("CULTURE_NAME")) {
                        lgs.setCULTURE_NAME(xpp.nextText());
                    }
                    if (xpp.getName().equals("NOTICE_URL")) {
                        lgs.setNOTICE_URL(xpp.nextText());
                    }

                    if (xpp.getName().equals("COUNTRY_ID")) {
                        lgs.setCOUNTRY_ID(xpp.nextText());
                    }
                }
                xpp.next();
            }
        } catch (XmlPullParserException e) {

            e.printStackTrace();
        } catch (IOException e) {

            e.printStackTrace();
        }
        return lgs;
    }

    // JCP XML HANDLER
    public static JourneyPlanGetterSetter JCPXMLHandler(XmlPullParser xpp, int eventType) {
        JourneyPlanGetterSetter jcpGetterSetter = new JourneyPlanGetterSetter();

        try {
            while (xpp.getEventType() != XmlPullParser.END_DOCUMENT) {
                if (xpp.getEventType() == XmlPullParser.START_TAG) {


                    if (xpp.getName().equals("META_DATA")) {
                        jcpGetterSetter.setTable_journey_plan(xpp.nextText());
                    }

                    if (xpp.getName().equals("STORE_ID")) {
                        jcpGetterSetter.setSTORE_ID(xpp.nextText());
                    }
                    if (xpp.getName().equals("EMP_ID")) {
                        jcpGetterSetter.setEMP_ID(xpp.nextText());
                    }

                    if (xpp.getName().equals("STORE_NAME")) {
                        jcpGetterSetter.setSTORE_NAME(xpp.nextText());
                        //jcpGetterSetter.setSTORE_NAME("Dummy Store");
                    }
                    if (xpp.getName().equals("CITY")) {
                        jcpGetterSetter.setCITY(xpp.nextText());
                    }
                    if (xpp.getName().equals("VISIT_DATE")) {
                        jcpGetterSetter.setVISIT_DATE(xpp.nextText());
                    }
                    if (xpp.getName().equals("ADDRESS")) {
                        jcpGetterSetter.setADDRESS(xpp.nextText());
                        //jcpGetterSetter.setADDRESS("Dummy Address");
                    }
                    if (xpp.getName().equals("UPLOAD_STATUS")) {
                        jcpGetterSetter.setUPLOAD_STATUS(xpp.nextText());
                    }

                    if (xpp.getName().equals("STORETYPE")) {
                        jcpGetterSetter.setSTORETYPE(xpp.nextText());
                    }

                    if (xpp.getName().equals("KEYACCOUNT_ID")) {
                        jcpGetterSetter.setKEYACCOUNT_ID(xpp.nextText());
                    }

                    if (xpp.getName().equals("STORETYPE_ID")) {
                        jcpGetterSetter.setSTORETYPE_ID(xpp.nextText());
                    }

                    if (xpp.getName().equals("CHECKOUT_STATUS")) {
                        jcpGetterSetter.setCHECKOUT_STATUS(xpp.nextText());
//							jcpGetterSetter.setCHECKOUT_STATUS("N");
                    }

                    if (xpp.getName().equals("CLASSIFICATION")) {
                        jcpGetterSetter.setCLASSIFICATION(xpp.nextText());
                    }

                    if (xpp.getName().equals("KEYACCOUNT")) {
                        jcpGetterSetter.setKEYACCOUNT(xpp.nextText());
                    }

                    if (xpp.getName().equals("CLASS_ID")) {
                        jcpGetterSetter.setCLASS_ID(xpp.nextText());
                    }

                    if (xpp.getName().equals("CAMERA_ALLOW")) {
                        jcpGetterSetter.setCAMERA_ALLOW(xpp.nextText());
                    }

                    if (xpp.getName().equals("GEO_TAG")) {
                        jcpGetterSetter.setGEO_TAG(xpp.nextText());
                    }

                    if (xpp.getName().equals("CHANNEL_ID")) {
                        jcpGetterSetter.setCHANNEL_ID(xpp.nextText());
                    }

                    if (xpp.getName().equals("VISIT_ORDER")) {
                        jcpGetterSetter.setVISIT_ORDER(xpp.nextText());
                    }

                    if (xpp.getName().equals("LATITUDE")) {
                        jcpGetterSetter.setLATITUDE(xpp.nextText());
                    }

                    if (xpp.getName().equals("LONGITUDE")) {
                        jcpGetterSetter.setLONGITUDE(xpp.nextText());
                    }
                    if (xpp.getName().equals("POG_TYPE_ID")) {
                        jcpGetterSetter.setPOG_TYPE_ID(xpp.nextText());
                    }
                }
                xpp.next();
            }
        } catch (XmlPullParserException e) {
            e.printStackTrace();
        } catch (IOException e) {
            e.printStackTrace();
        }
        return jcpGetterSetter;
    }

    // SKU_MASTER XML HANDLER
    public static SkuMasterGetterSetter skuMasterXMLHandler(XmlPullParser xpp,
                                                            int eventType) {
        SkuMasterGetterSetter sku = new SkuMasterGetterSetter();

        try {
            while (xpp.getEventType() != XmlPullParser.END_DOCUMENT) {
                if (xpp.getEventType() == XmlPullParser.START_TAG) {
                    if (xpp.getName().equals("META_DATA")) {
                        sku.setTable_SKU_MASTER(xpp.nextText());
                    }
                    if (xpp.getName().equals("SKU_ID")) {
                        sku.setSKU_ID(xpp.nextText());
                    }
                    if (xpp.getName().equals("SKU")) {
                        sku.setSKU(xpp.nextText());
                    }
                    if (xpp.getName().equals("BRAND_ID")) {
                        sku.setBRAND_ID(xpp.nextText());
                    }
                    if (xpp.getName().equals("MRP")) {
                        sku.setMRP(xpp.nextText());
                    }
                    if (xpp.getName().equals("SKU_SEQUENCE")) {
                        sku.setSKU_SEQUENCE(xpp.nextText());
                    }
                    if (xpp.getName().equals("PROMO_SKU")) {
                        sku.setPROMO_SKU(xpp.nextText());
                    }

                }
                xpp.next();
            }
        } catch (XmlPullParserException e) {

            e.printStackTrace();
        } catch (IOException e) {

            e.printStackTrace();
        }
        return sku;
    }

    // BRAND_MASTER XML HANDLER
    public static BrandMasterGetterSetter brandMasterXMLHandler(XmlPullParser xpp,
                                                                int eventType) {
        BrandMasterGetterSetter brand = new BrandMasterGetterSetter();

        try {
            while (xpp.getEventType() != XmlPullParser.END_DOCUMENT) {
                if (xpp.getEventType() == XmlPullParser.START_TAG) {
                    if (xpp.getName().equals("META_DATA")) {
                        brand.setTable_BRAND_MASTER(xpp.nextText());
                    }
                    if (xpp.getName().equals("BRAND_ID")) {
                        brand.setBRAND_ID(xpp.nextText());
                    }
                    if (xpp.getName().equals("BRAND")) {
                        brand.setBRAND(xpp.nextText());
                    }
                    if (xpp.getName().equals("SUB_CATEGORY_ID")) {
                        brand.setSUB_CATEGORY_ID(xpp.nextText());
                    }
                    if (xpp.getName().equals("COMPANY_ID")) {
                        brand.setCOMPANY_ID(xpp.nextText());
                    }
                    if (xpp.getName().equals("BRAND_SEQUENCE")) {
                        brand.setBRAND_SEQUENCE(xpp.nextText());
                    }

                }
                xpp.next();
            }
        } catch (XmlPullParserException e) {

            e.printStackTrace();
        } catch (IOException e) {

            e.printStackTrace();
        }
        return brand;
    }

    // SUB_CATEGORY_MASTER XML HANDLER
    public static SubCategoryMasterGetterSetter subCategoryMasterXMLHandler(XmlPullParser xpp,
                                                                            int eventType) {
        SubCategoryMasterGetterSetter category = new SubCategoryMasterGetterSetter();

        try {
            while (xpp.getEventType() != XmlPullParser.END_DOCUMENT) {
                if (xpp.getEventType() == XmlPullParser.START_TAG) {
                    if (xpp.getName().equals("META_DATA")) {
                        category.setTable_SUB_CATEGORY_MASTER(xpp.nextText());
                    }
                    if (xpp.getName().equals("SUB_CATEGORY_ID")) {
                        category.setSUB_CATEGORY_ID(xpp.nextText());
                    }
                    if (xpp.getName().equals("SUB_CATEGORY")) {
                        category.setSUB_CATEGORY(xpp.nextText());
                    }
                    if (xpp.getName().equals("CATEGORY_ID")) {
                        category.setCATEGORY_ID(xpp.nextText());
                    }
                    if (xpp.getName().equals("SUB_CATEGORY_SEQUENCE")) {
                        category.setSUB_CATEGORY_SEQUENCE(xpp.nextText());
                    }

                }
                xpp.next();
            }
        } catch (XmlPullParserException e) {

            e.printStackTrace();
        } catch (IOException e) {

            e.printStackTrace();
        }
        return category;
    }

    // CATEGORY_MASTER XML HANDLER
    public static CategoryMasterGetterSetter categoryMasterXMLHandler(XmlPullParser xpp,
                                                                      int eventType) {
        CategoryMasterGetterSetter category = new CategoryMasterGetterSetter();

        try {
            while (xpp.getEventType() != XmlPullParser.END_DOCUMENT) {
                if (xpp.getEventType() == XmlPullParser.START_TAG) {
                    if (xpp.getName().equals("META_DATA")) {
                        category.setTable_CATEGORY_MASTER(xpp.nextText());
                    }
                    if (xpp.getName().equals("CATEGORY_ID")) {
                        category.setCATEGORY_ID(xpp.nextText());
                    }
                    if (xpp.getName().equals("CATEGORY")) {
                        category.setCATEGORY(xpp.nextText());
                    }
                    if (xpp.getName().equals("CATEGORY_SEQUENCE")) {
                        category.setCATEGORY_SEQUENCE(xpp.nextText());
                    }
                }
                xpp.next();
            }
        } catch (XmlPullParserException e) {

            e.printStackTrace();
        } catch (IOException e) {

            e.printStackTrace();
        }
        return category;
    }

    // DISPLAY_MASTER XML HANDLER
    public static DisplayMasterGetterSetter displayMasterXMLHandler(XmlPullParser xpp,
                                                                    int eventType) {
        DisplayMasterGetterSetter display = new DisplayMasterGetterSetter();

        try {
            while (xpp.getEventType() != XmlPullParser.END_DOCUMENT) {
                if (xpp.getEventType() == XmlPullParser.START_TAG) {
                    if (xpp.getName().equals("META_DATA")) {
                        display.setTable_DISPLAY_MASTER(xpp.nextText());
                    }
                    if (xpp.getName().equals("DISPLAY_ID")) {
                        display.setDISPLAY_ID(xpp.nextText());
                    }
                    if (xpp.getName().equals("DISPLAY")) {
                        display.setDISPLAY(xpp.nextText());
                    }
                    if (xpp.getName().equals("IMAGE_URL")) {
                        display.setIMAGE_URL(xpp.nextText());
                    }
                    if (xpp.getName().equals("IMAGE_PATH")) {
                        display.setIMAGE_PATH(xpp.nextText());
                    }

                }
                xpp.next();
            }
        } catch (XmlPullParserException e) {

            e.printStackTrace();
        } catch (IOException e) {

            e.printStackTrace();
        }
        return display;
    }

    // MAPPING_STOCK XML HANDLER
    public static MappingStockGetterSetter mappingStockXMLHandler(XmlPullParser xpp,
                                                                  int eventType) {
        MappingStockGetterSetter stock = new MappingStockGetterSetter();

        try {
            while (xpp.getEventType() != XmlPullParser.END_DOCUMENT) {
                if (xpp.getEventType() == XmlPullParser.START_TAG) {
                    if (xpp.getName().equals("META_DATA")) {
                        stock.setTable_MAPPING_STOCK(xpp.nextText());
                    }
                    if (xpp.getName().equals("KEYACCOUNT_ID")) {
                        stock.setKEYACCOUNT_ID(xpp.nextText());
                    }
                    if (xpp.getName().equals("STORETYPE_ID")) {
                        stock.setSTORETYPE_ID(xpp.nextText());
                    }
                    if (xpp.getName().equals("CLASS_ID")) {
                        stock.setCLASS_ID(xpp.nextText());
                    }
                    if (xpp.getName().equals("SKU_ID")) {
                        stock.setSKU_ID(xpp.nextText());
                    }
                    if (xpp.getName().equals("MUST_HAVE")) {
                        stock.setMUST_HAVE(xpp.nextText());
                    }
                    if (xpp.getName().equals("MBQ")) {
                        stock.setMBQ(xpp.nextText());
                    }if (xpp.getName().equals("SHOW_ADDITIONAL_VISIBILITY")) {
                        stock.setSHOW_ADDITIONAL_VISIBILITY(xpp.nextText());
                    }
                }
                xpp.next();
            }
        } catch (XmlPullParserException e) {

            e.printStackTrace();
        } catch (IOException e) {

            e.printStackTrace();
        }
        return stock;
    }

    // MAPPING_STOCK_STOREWISE XML HANDLER
    public static MappingStockStorewiseGetterSetter mappingStockStorewiseXMLHandler(XmlPullParser xpp,
                                                                                    int eventType) {
        MappingStockStorewiseGetterSetter stock = new MappingStockStorewiseGetterSetter();

        try {
            while (xpp.getEventType() != XmlPullParser.END_DOCUMENT) {
                if (xpp.getEventType() == XmlPullParser.START_TAG) {
                    if (xpp.getName().equals("META_DATA")) {
                        stock.setTable_MAPPING_STOCK_STOREWISE(xpp.nextText());
                    }
                    if (xpp.getName().equals("STORE_ID")) {
                        stock.setSTORE_ID(xpp.nextText());
                    }
                    if (xpp.getName().equals("SKU_ID")) {
                        stock.setSKU_ID(xpp.nextText());
                    }
                    if (xpp.getName().equals("MUST_HAVE")) {
                        stock.setMUST_HAVE(xpp.nextText());
                    }
                    if (xpp.getName().equals("MBQ")) {
                        stock.setMBQ(xpp.nextText());
                    }if (xpp.getName().equals("SHOW_ADDITIONAL_VISIBILITY")) {
                        stock.setSHOW_ADDITIONAL_VISIBILITY(xpp.nextText());
                    }
                }
                xpp.next();
            }
        } catch (XmlPullParserException e) {

            e.printStackTrace();
        } catch (IOException e) {

            e.printStackTrace();
        }
        return stock;
    }

    // MAPPING_T2P XML HANDLER
    public static MAPPINGT2PGetterSetter mappingT2pXMLHandler(XmlPullParser xpp,
                                                              int eventType) {
        MAPPINGT2PGetterSetter t2p = new MAPPINGT2PGetterSetter();

        try {
            while (xpp.getEventType() != XmlPullParser.END_DOCUMENT) {
                if (xpp.getEventType() == XmlPullParser.START_TAG) {
                    if (xpp.getName().equals("META_DATA")) {
                        t2p.setTable_MAPPING_T2P(xpp.nextText());
                    }
                    if (xpp.getName().equals("STORE_ID")) {
                        t2p.setSTORE_ID(xpp.nextText());
                    }
                    if (xpp.getName().equals("BRAND_ID")) {
                        t2p.setBRAND_ID(xpp.nextText());
                    }
                    if (xpp.getName().equals("DISPLAY_ID")) {
                        t2p.setDISPLAY_ID(xpp.nextText());
                    }
                    if (xpp.getName().equals("CATEGORY_FIXTURE")) {
                        t2p.setCATEGORY_FIXTURE(xpp.nextText());
                    }
                }
                xpp.next();
            }
        } catch (XmlPullParserException e) {

            e.printStackTrace();
        } catch (IOException e) {

            e.printStackTrace();
        }
        return t2p;
    }

    // DISPLAY_CHECKLIST_MASTER XML HANDLER
    public static DisplayChecklistMasterGetterSetter mappingDisplayChecklistMasterXMLHandler(XmlPullParser xpp,
                                                                                             int eventType) {
        DisplayChecklistMasterGetterSetter checklist = new DisplayChecklistMasterGetterSetter();

        try {
            while (xpp.getEventType() != XmlPullParser.END_DOCUMENT) {
                if (xpp.getEventType() == XmlPullParser.START_TAG) {
                    if (xpp.getName().equals("META_DATA")) {
                        checklist.setTable_DISPLAY_CHECKLIST_MASTER(xpp.nextText());
                    }
                    if (xpp.getName().equals("CHECKLIST_ID")) {
                        checklist.setCHECKLIST_ID(xpp.nextText());
                    }
                    if (xpp.getName().equals("CHECKLIST")) {
                        checklist.setCHECKLIST(xpp.nextText());
                    }

                }
                xpp.next();
            }
        } catch (XmlPullParserException e) {

            e.printStackTrace();
        } catch (IOException e) {

            e.printStackTrace();
        }
        return checklist;
    }

    // MAPPING_DISPLAY_CHECKLIST XML HANDLER
    public static MappingDisplayChecklistGetterSetter mappingMappingDisplayChecklistXMLHandler(XmlPullParser xpp,
                                                                                               int eventType) {
        MappingDisplayChecklistGetterSetter checklist = new MappingDisplayChecklistGetterSetter();

        try {
            while (xpp.getEventType() != XmlPullParser.END_DOCUMENT) {
                if (xpp.getEventType() == XmlPullParser.START_TAG) {
                    if (xpp.getName().equals("META_DATA")) {
                        checklist.setTable_MAPPING_DISPLAY_CHECKLIST(xpp.nextText());
                    }
                    if (xpp.getName().equals("CHECKLIST_ID")) {
                        checklist.setCHECKLIST_ID(xpp.nextText());
                    }
                    if (xpp.getName().equals("DISPLAY_ID")) {
                        checklist.setDISPLAY_ID(xpp.nextText());
                    }
                }
                xpp.next();
            }
        } catch (XmlPullParserException e) {

            e.printStackTrace();
        } catch (IOException e) {

            e.printStackTrace();
        }
        return checklist;
    }

    // NON_WORKING_REASON XML HANDLER
    public static NonWorkingReasonGetterSetter nonWorkingReasonXMLHandler(XmlPullParser xpp,
                                                                          int eventType) {
        NonWorkingReasonGetterSetter reason = new NonWorkingReasonGetterSetter();

        try {
            while (xpp.getEventType() != XmlPullParser.END_DOCUMENT) {
                if (xpp.getEventType() == XmlPullParser.START_TAG) {
                    if (xpp.getName().equals("META_DATA")) {
                        reason.setTable_NON_WORKING_REASON(xpp.nextText());
                    }
                    if (xpp.getName().equals("REASON_ID")) {
                        reason.setREASON_ID(xpp.nextText());
                    }
                    if (xpp.getName().equals("REASON")) {
                        reason.setREASON(xpp.nextText());
                    }
                    if (xpp.getName().equals("ENTRY_ALLOW")) {
                        reason.setENTRY_ALLOW(xpp.nextText());
                    }
                    if (xpp.getName().equals("IMAGE_ALLOW")) {
                        reason.setIMAGE_ALLOW(xpp.nextText());
                    }

                    if (xpp.getName().equals("REMARK_REQUIRED")) {
                        reason.setREMARK_REQUIRED(xpp.nextText());
                    }
                    if (xpp.getName().equals("REMARK_TYPE")) {
                        reason.setREMARK_TYPE(xpp.nextText());
                    }
                    if (xpp.getName().equals("REMARK_LABEL")) {
                        reason.setREMARK_LABEL(xpp.nextText());
                    }
                    if (xpp.getName().equals("REMARK_MANDATORY")) {
                        reason.setREMARK_MANDATORY(xpp.nextText());
                    }
                }
                xpp.next();
            }
        } catch (XmlPullParserException e) {

            e.printStackTrace();
        } catch (IOException e) {

            e.printStackTrace();
        }
        return reason;
    }

    // MAPPING_PROMOTION XML HANDLER
    public static MappingPromotionGetterSetter mappingPromotionXMLHandler(XmlPullParser xpp, int eventType) {
        MappingPromotionGetterSetter t2p = new MappingPromotionGetterSetter();

        try {
            while (xpp.getEventType() != XmlPullParser.END_DOCUMENT) {
                if (xpp.getEventType() == XmlPullParser.START_TAG) {

                    if (xpp.getName().equals("META_DATA")) {
                        t2p.setTable_MAPPING_PROMOTION(xpp.nextText());
                    }
                    if (xpp.getName().equals("STORE_ID")) {
                        t2p.setSTORE_ID(xpp.nextText());
                    }
                    if (xpp.getName().equals("SKU_ID")) {
                        t2p.setSKU_ID(xpp.nextText());
                    }
                    if (xpp.getName().equals("SKU")) {
                        t2p.setSKU(xpp.nextText());
                    }
                    if (xpp.getName().equals("PROMO_ID")) {
                        t2p.setPROMO_ID(xpp.nextText());
                    }
                    if (xpp.getName().equals("PROMO")) {
                        t2p.setPROMO(xpp.nextText());
                    }
                }
                xpp.next();
            }
        } catch (XmlPullParserException e) {
            e.printStackTrace();
        } catch (IOException e) {
            e.printStackTrace();
        }
        return t2p;
    }

    //Gagan Start Code

    //MAPPING_ADDITIONAL_PROMOTION
    public static MAPPING_ADDITIONAL_PROMOTION_MasterGetterSetter mappingAdditionalPromotionXMLHandler(XmlPullParser xpp, int eventType) {
        MAPPING_ADDITIONAL_PROMOTION_MasterGetterSetter map = new MAPPING_ADDITIONAL_PROMOTION_MasterGetterSetter();

        try {
            while (xpp.getEventType() != XmlPullParser.END_DOCUMENT) {
                if (xpp.getEventType() == XmlPullParser.START_TAG) {

                    if (xpp.getName().equals("META_DATA")) {
                        map.setTable_MAPPING_ADDITIONAL_PROMOTION(xpp.nextText());
                    }
                    if (xpp.getName().equals("STORE_ID")) {
                        map.setSTORE_ID(xpp.nextText());
                    }
                    if (xpp.getName().equals("SKU_ID")) {
                        map.setSKU_ID(xpp.nextText());
                    }
                    if (xpp.getName().equals("SKU")) {
                        map.setSKU(xpp.nextText());
                    }
                    if (xpp.getName().equals("PROMO_ID")) {
                        map.setPROMO_ID(xpp.nextText());
                    }
                    if (xpp.getName().equals("PROMO")) {
                        map.setPROMO(xpp.nextText());
                    }
                }
                xpp.next();
            }
        } catch (XmlPullParserException e) {
            e.printStackTrace();
        } catch (IOException e) {
            e.printStackTrace();
        }
        return map;
    }


    public static STORE_PERFORMANCE_MasterGetterSetter STORE_PERFORMANCEXMLHandler(XmlPullParser xpp, int eventType) {
        STORE_PERFORMANCE_MasterGetterSetter st = new STORE_PERFORMANCE_MasterGetterSetter();

        try {
            while (xpp.getEventType() != XmlPullParser.END_DOCUMENT) {
                if (xpp.getEventType() == XmlPullParser.START_TAG) {

                    if (xpp.getName().equals("META_DATA")) {
                        st.setTable_STORE_PERFORMANCE(xpp.nextText());
                    }
                    if (xpp.getName().equals("STORE_ID")) {
                        st.setSTORE_ID(xpp.nextText());
                    }
                    if (xpp.getName().equals("CATEGORY_ID")) {
                        st.setCATEGORY_ID(xpp.nextText());
                    }
                    if (xpp.getName().equals("PERIOD")) {
                        st.setPERIOD(xpp.nextText());
                    }
                    if (xpp.getName().equals("SOS")) {
                        st.setSOS(xpp.nextText());
                    }
                    if (xpp.getName().equals("T2P")) {
                        st.setT2P(xpp.nextText());
                    }
                    if (xpp.getName().equals("PROMO")) {
                        st.setPROMO(xpp.nextText());
                    }
                    if (xpp.getName().equals("MSL")) {
                        st.setMSL_AVAILABILITY(xpp.nextText());
                    }
                    if (xpp.getName().equals("OSS")) {
                        st.setOSS(xpp.nextText());
                    }
                    if (xpp.getName().equals("ORDERID")) {
                        st.setORDERID(xpp.nextText());
                    }
                    if (xpp.getName().equals("PLANOGRAM")) {
                        st.setPLANOGRAM(xpp.nextText());
                    }

                }
                xpp.next();
            }
        } catch (XmlPullParserException e) {
            e.printStackTrace();
        } catch (IOException e) {
            e.printStackTrace();
        }
        return st;
    }

    public static MAPPING_PLANOGRAM_MasterGetterSetter MAPPING_PLANOGRAM_XMLHandler(XmlPullParser xpp, int eventType) {
        MAPPING_PLANOGRAM_MasterGetterSetter st = new MAPPING_PLANOGRAM_MasterGetterSetter();

        try {
            while (xpp.getEventType() != XmlPullParser.END_DOCUMENT) {
                if (xpp.getEventType() == XmlPullParser.START_TAG) {

                    if (xpp.getName().equals("META_DATA")) {
                        st.setTable_MAPPING_PLANOGRAM(xpp.nextText());
                    }
                    if (xpp.getName().equals("KEYACCOUNT_ID")) {
                        st.setKEYACCOUNT_ID(xpp.nextText());
                    }
                    if (xpp.getName().equals("STORETYPE_ID")) {
                        st.setSTORETYPE_ID(xpp.nextText());
                    }
                    if (xpp.getName().equals("CLASS_ID")) {
                        st.setCLASS_ID(xpp.nextText());
                    }
                    if (xpp.getName().equals("CATEGORY_ID")) {
                        st.setCATEGORY_ID(xpp.nextText());
                    }
                    if (xpp.getName().equals("PLANOGRAM_IMAGE")) {
                        st.setPLANOGRAM_IMAGE(xpp.nextText());
                    }
                    if (xpp.getName().equals("IMAGE_PATH")) {
                        st.setIMAGE_PATH(xpp.nextText());
                    }
                }
                xpp.next();
            }
        } catch (XmlPullParserException e) {
            e.printStackTrace();
        } catch (IOException e) {
            e.printStackTrace();
        }
        return st;
    }
    //Gagan End Code


    public static ADDITIONAL_DISPLAY_MASTERGetterSetter ADDITIONAL_DISPLAY_MASTERXMLHandler(XmlPullParser xpp, int eventType) {
        ADDITIONAL_DISPLAY_MASTERGetterSetter st = new ADDITIONAL_DISPLAY_MASTERGetterSetter();

        try {
            while (xpp.getEventType() != XmlPullParser.END_DOCUMENT) {
                if (xpp.getEventType() == XmlPullParser.START_TAG) {

                    if (xpp.getName().equals("META_DATA")) {
                        st.setTable_STORE_ADDITIONAL_DISPLAY(xpp.nextText());
                    }
                    if (xpp.getName().equals("DISPLAY_ID")) {
                        st.setDISPLAY_ID(xpp.nextText());
                    }
                    if (xpp.getName().equals("DISPLAY")) {
                        st.setDISPLAY(xpp.nextText());
                    }
                    if (xpp.getName().equals("IMAGE_URL")) {
                        st.setIMAGE_URL(xpp.nextText());
                    }
                    if (xpp.getName().equals("IMAGE_PATH")) {
                        st.setIMAGE_PATH(xpp.nextText());
                    }
                    if (xpp.getName().equals("CATEGORY_ID")) {
                        st.setCATEGORY_ID(xpp.nextText());
                    }

                }
                xpp.next();
            }
        } catch (XmlPullParserException e) {
            e.printStackTrace();
        } catch (IOException e) {
            e.printStackTrace();
        }
        return st;
    }

    public static MAPPING_SOS_TARGET_MasterGetterSetter MAPPING_SOS_TARGETXMLHandler(XmlPullParser xpp, int eventType) {
        MAPPING_SOS_TARGET_MasterGetterSetter st = new MAPPING_SOS_TARGET_MasterGetterSetter();

        try {
            while (xpp.getEventType() != XmlPullParser.END_DOCUMENT) {
                if (xpp.getEventType() == XmlPullParser.START_TAG) {

                    if (xpp.getName().equals("META_DATA")) {
                        st.setTable_MAPPING_SOS_TARGET(xpp.nextText());
                    }
                    if (xpp.getName().equals("STORE_ID")) {
                        st.setSTORE_ID(xpp.nextText());
                    }
                    if (xpp.getName().equals("BRAND_ID")) {
                        st.setBRAND_ID(xpp.nextText());
                    }
                    if (xpp.getName().equals("SOS_TARGET")) {
                        st.setSOS_TARGET(xpp.nextText());
                    }
                }
                xpp.next();
            }
        } catch (XmlPullParserException e) {
            e.printStackTrace();
        } catch (IOException e) {
            e.printStackTrace();
        }
        return st;
    }

    public static ShelfMasterGetterSetter shelfMasterXMLHandler(XmlPullParser xpp, int eventType) {
        ShelfMasterGetterSetter st = new ShelfMasterGetterSetter();

        try {
            while (xpp.getEventType() != XmlPullParser.END_DOCUMENT) {
                if (xpp.getEventType() == XmlPullParser.START_TAG) {

                    if (xpp.getName().equals("META_DATA")) {
                        st.setTable_SHELF_MASTER(xpp.nextText());
                    }
                    if (xpp.getName().equals("SHELF_ID")) {
                        st.setSHELF_ID(xpp.nextText());
                    }
                    if (xpp.getName().equals("SHELF")) {
                        st.setSHELF(xpp.nextText());
                    }
                }
                xpp.next();
            }
        } catch (XmlPullParserException e) {
            e.printStackTrace();
        } catch (IOException e) {
            e.printStackTrace();
        }
        return st;
    }

    public static MappingSubCategoryImageAllowGetterSetter mappingSubCategoryImageAllowXMLHandler(XmlPullParser xpp, int eventType) {
        MappingSubCategoryImageAllowGetterSetter st = new MappingSubCategoryImageAllowGetterSetter();

        try {
            while (xpp.getEventType() != XmlPullParser.END_DOCUMENT) {
                if (xpp.getEventType() == XmlPullParser.START_TAG) {

                    if (xpp.getName().equals("META_DATA")) {
                        st.setTable_MAPPING_SUB_CATEGORY_IMAGE_ALLOW(xpp.nextText());
                    }
                    if (xpp.getName().equals("COUNTRY_ID")) {
                        st.setCOUNTRY_ID(xpp.nextText());
                    }
                    if (xpp.getName().equals("SUB_CATEGORY_ID")) {
                        st.setSUB_CATEGORY_ID(xpp.nextText());
                    }
                    if (xpp.getName().equals("IMAGE_ALLOW")) {
                        st.setIMAGE_ALLOW(xpp.nextText());
                    }

                }
                xpp.next();
            }
        } catch (XmlPullParserException e) {
            e.printStackTrace();
        } catch (IOException e) {
            e.printStackTrace();
        }
        return st;
    }

    //MAPPING_CATEGORY_IMAGE_ALLOW
    public static MappingCategoryImageAllowGetterSetter mappingCategoryImageAllowXMLHandler(XmlPullParser xpp, int eventType) {
        MappingCategoryImageAllowGetterSetter st = new MappingCategoryImageAllowGetterSetter();

        try {
            while (xpp.getEventType() != XmlPullParser.END_DOCUMENT) {
                if (xpp.getEventType() == XmlPullParser.START_TAG) {

                    if (xpp.getName().equals("META_DATA")) {
                        st.setTable_MAPPING_CATEGORY_IMAGE_ALLOW(xpp.nextText());
                    }
                    if (xpp.getName().equals("COUNTRY_ID")) {
                        st.setCOUNTRY_ID(xpp.nextText());
                    }
                    if (xpp.getName().equals("CATEGORY_ID")) {
                        st.setCATEGORY_ID(xpp.nextText());
                    }
                    if (xpp.getName().equals("IMAGE1_ALLOW")) {
                        st.setIMAGE1_ALLOW(xpp.nextText());
                    }
                    if (xpp.getName().equals("IMAGE2_ALLOW")) {
                        st.setIMAGE2_ALLOW(xpp.nextText());
                    }
                    if (xpp.getName().equals("IMAGE3_ALLOW")) {
                        st.setIMAGE3_ALLOW(xpp.nextText());
                    }
                    if (xpp.getName().equals("IMAGE4_ALLOW")) {
                        st.setIMAGE4_ALLOW(xpp.nextText());
                    }
                }
                xpp.next();
            }
        } catch (XmlPullParserException e) {
            e.printStackTrace();
        } catch (IOException e) {
            e.printStackTrace();
        }
        return st;
    }

    //SKUGROUP_MASTER
    public static SkuGroupMasterGetterSetter skuGroupMasterXMLHandler(XmlPullParser xpp, int eventType) {
        SkuGroupMasterGetterSetter st = new SkuGroupMasterGetterSetter();

        try {
            while (xpp.getEventType() != XmlPullParser.END_DOCUMENT) {
                if (xpp.getEventType() == XmlPullParser.START_TAG) {

                    if (xpp.getName().equals("META_DATA")) {
                        st.setTable_SKUGROUP_MASTER(xpp.nextText());
                    }
                    if (xpp.getName().equals("SKUGROUP_ID")) {
                        st.setSKUGROUP_ID(xpp.nextText());
                    }
                    if (xpp.getName().equals("SKUGROUP_NAME")) {
                        st.setSKUGROUP_NAME(xpp.nextText());
                    }
                    if (xpp.getName().equals("CATEGORY_ID")) {
                        st.setCATEGORY_ID(xpp.nextText());
                    }
                    if (xpp.getName().equals("SUB_CATEGORY_ID")) {
                        st.setSUB_CATEGORY_ID(xpp.nextText());
                    }
                    if (xpp.getName().equals("SKUGROUP_SEQUENCE")) {
                        st.setSKUGROUP_SEQUENCE(xpp.nextText());
                    }

                }
                xpp.next();
            }
        } catch (XmlPullParserException e) {
            e.printStackTrace();
        } catch (IOException e) {
            e.printStackTrace();
        }
        return st;
    }

    //MAPPING_COUNTRYWISE_PLANOGRAM
    public static MappingPlanogramCountrywiseGetterSetter MAPPING_COUNTRYWISE_PLANOGRAM_XMLHandler(XmlPullParser xpp, int eventType) {
        MappingPlanogramCountrywiseGetterSetter st = new MappingPlanogramCountrywiseGetterSetter();

        try {
            while (xpp.getEventType() != XmlPullParser.END_DOCUMENT) {
                if (xpp.getEventType() == XmlPullParser.START_TAG) {

                    if (xpp.getName().equals("META_DATA")) {
                        st.setTable_MAPPING_COUNTRYWISE_PLANOGRAM(xpp.nextText());
                    }
                    if (xpp.getName().equals("COUNTRY_ID")) {
                        st.setCOUNTRY_ID(xpp.nextText());
                    }
                    if (xpp.getName().equals("FILE_PATH")) {
                        st.setFILE_PATH(xpp.nextText());
                    }
                    if (xpp.getName().equals("PLANOGRAM_URL")) {
                        st.setPLANOGRAM_URL(xpp.nextText());
                    }
                }
                xpp.next();
            }
        } catch (XmlPullParserException e) {
            e.printStackTrace();
        } catch (IOException e) {
            e.printStackTrace();
        }
        return st;
    }

    //ADDITIONAL_QUESTION
    public static AdditionalQuestiongetterSetter additionalXMLHandler(XmlPullParser xpp, int eventType) {
        AdditionalQuestiongetterSetter st = new AdditionalQuestiongetterSetter();

        try {
            while (xpp.getEventType() != XmlPullParser.END_DOCUMENT) {
                if (xpp.getEventType() == XmlPullParser.START_TAG) {

                    if (xpp.getName().equals("META_DATA")) {
                        st.setTable_ADDITIONAL_QUESTION(xpp.nextText());
                    }
                    if (xpp.getName().equals("QUESTION_ID")) {
                        st.setQUESTION_ID(xpp.nextText());
                    }
                    if (xpp.getName().equals("CATEGORY_ID")) {
                        st.setCATEGORY_ID(xpp.nextText());
                    }
                    if (xpp.getName().equals("QUESTION")) {
                        st.setQUESTION(xpp.nextText());
                    }
                    if (xpp.getName().equals("CULTURE_ID")) {
                        st.setCULTURE_ID(xpp.nextText());
                    }
                    if (xpp.getName().equals("ANSWER_TYPE")) {
                        st.setANSWER_TYPE(xpp.nextText());
                    }
                    if (xpp.getName().equals("ANSWER_ID")) {
                        st.setANSWER_ID(xpp.nextText());
                    }
                    if (xpp.getName().equals("ANSWER")) {
                        st.setANSWER(xpp.nextText());
                    }
                    if (xpp.getName().equals("STORETYPE_ID")) {
                        st.setSTORETYPE_ID(xpp.nextText());
                    }
                    if (xpp.getName().equals("CAMERA_ALLOW")) {
                        st.setCAMERA_ALLOW(xpp.nextText());
                    }
                    if (xpp.getName().equals("KEYACCOUNT_ID")) {
                        st.setKEYACCOUNT_ID(xpp.nextText());
                    }
                    if (xpp.getName().equals("NO_OF_CAMERA")) {
                        st.setNO_OF_CAMERA(xpp.nextText());
                    }
                    if (xpp.getName().equals("QTYPE")) {
                        st.setTYPE(xpp.nextText());
                    }
                }
                xpp.next();
            }
        } catch (XmlPullParserException e) {
            e.printStackTrace();
        } catch (IOException e) {
            e.printStackTrace();
        }
        return st;
    }

    //POG_QUESTION
    public static POGQuestionGetterSetter pogQuestionsXMLHandler(XmlPullParser xpp, int eventType) {
        POGQuestionGetterSetter st = new POGQuestionGetterSetter();

        try {
            while (xpp.getEventType() != XmlPullParser.END_DOCUMENT) {
                if (xpp.getEventType() == XmlPullParser.START_TAG) {

                    if (xpp.getName().equals("META_DATA")) {
                        st.setTable_POG_QUESTION(xpp.nextText());
                    }
                    if (xpp.getName().equals("QUESTION_ID")) {
                        st.setQUESTION_ID(xpp.nextText());
                    }
                    if (xpp.getName().equals("SUB_CATEGORY_ID")) {
                        st.setSUB_CATEGORY_ID(xpp.nextText());
                    }
                    if (xpp.getName().equals("QUESTION")) {
                        st.setQUESTION(xpp.nextText());
                    }
                    if (xpp.getName().equals("CULTURE_ID")) {
                        st.setCULTURE_ID(xpp.nextText());
                    }
                    if (xpp.getName().equals("QTYPE_ID")) {
                        st.setQTYPE_ID(xpp.nextText());
                    }
                    if (xpp.getName().equals("ANSWER_ID")) {
                        st.setANSWER_ID(xpp.nextText());
                    }
                    if (xpp.getName().equals("ANSWER")) {
                        st.setANSWER(xpp.nextText());
                    }
                    if (xpp.getName().equals("QTYPE")) {
                        st.setQTYPE(xpp.nextText());
                    }
                    if (xpp.getName().equals("KPI")) {
                        st.setKPI(xpp.nextText());
                    }
                    if (xpp.getName().equals("STORETYPE_ID")) {
                        st.setSTORETYPE_ID(xpp.nextText());
                    }
                    if (xpp.getName().equals("POG_TYPE_ID")) {
                        st.setPOG_TYPE_ID(xpp.nextText());
                    }
                }
                xpp.next();
            }
        } catch (XmlPullParserException e) {
            e.printStackTrace();
        } catch (IOException e) {
            e.printStackTrace();
        }
        return st;
    }

    //POG_QUESTION
    public static NonT2pReasonGetterSetter nonT2pReasonXMLHandler(XmlPullParser xpp, int eventType) {
        NonT2pReasonGetterSetter st = new NonT2pReasonGetterSetter();

        try {
            while (xpp.getEventType() != XmlPullParser.END_DOCUMENT) {
                if (xpp.getEventType() == XmlPullParser.START_TAG) {

                    if (xpp.getName().equals("META_DATA")) {
                        st.setTable_NON_T2P_REASON(xpp.nextText());
                    }
                    if (xpp.getName().equals("TREASON")) {
                        st.setTREASON(xpp.nextText());
                    }
                    if (xpp.getName().equals("TREASON_ID")) {
                        st.setTREASON_ID(xpp.nextText());
                    }
                }
                xpp.next();
            }
        } catch (XmlPullParserException e) {
            e.printStackTrace();
        } catch (IOException e) {
            e.printStackTrace();
        }
        return st;
    }

    //CHAT_MESSAGE
    public static ChatMessageDownloadGetterSetter CHAT_MESSAGE_XMLHandler(XmlPullParser xpp, int eventType) {
        ChatMessageDownloadGetterSetter st = new ChatMessageDownloadGetterSetter();

        try {
            while (xpp.getEventType() != XmlPullParser.END_DOCUMENT) {
                if (xpp.getEventType() == XmlPullParser.START_TAG) {

                    if (xpp.getName().equals("META_DATA")) {
                        st.setTable_CHAT_MESSAGE(xpp.nextText());
                    }
                    if (xpp.getName().equals("REC_ID")) {
                        st.setREC_ID(xpp.nextText());
                    }
                    if (xpp.getName().equals("CHAT_ID")) {
                        st.setCHAT_ID(xpp.nextText());
                    }
                    if (xpp.getName().equals("MESSAGE")) {
                        st.setMESSAGE(xpp.nextText());
                    }
                    if (xpp.getName().equals("MESSAGEDATE")) {
                        st.setMESSAGEDATE(xpp.nextText());
                    }
                    if (xpp.getName().equals("SENDERID")) {
                        st.setSENDERID(xpp.nextText());
                    }
                    if (xpp.getName().equals("SENDER")) {
                        st.setSENDER(xpp.nextText());
                    }
                    if (xpp.getName().equals("RECEIVERID")) {
                        st.setRECEIVERID(xpp.nextText());
                    }
                    if (xpp.getName().equals("RECEIVER")) {
                        st.setRECEIVER(xpp.nextText());
                    }
                    if (xpp.getName().equals("COMMENTDATE")) {
                        st.setCOMMENTDATE(xpp.nextText());
                    }
                    if (xpp.getName().equals("COMMENT")) {
                        st.setCOMMENT(xpp.nextText());
                    }
                    if (xpp.getName().equals("STOREID")) {
                        st.setSTOREID(xpp.nextText());
                    }
                    if (xpp.getName().equals("ORDERID")) {
                        st.setORDERID(xpp.nextText());
                    }
                    if (xpp.getName().equals("SENDER_USERID")) {
                        st.setSENDER_USERID(xpp.nextText());
                    }
                }
                xpp.next();
            }
        } catch (XmlPullParserException e) {
            e.printStackTrace();
        } catch (IOException e) {
            e.printStackTrace();
        }
        return st;
    }

    //CONFIGURATION_COUNTRY_WISE
    public static ConfigurationContrywiseGetterSetter configurationCountryWiseXMLHandler(XmlPullParser xpp, int eventType) {
        ConfigurationContrywiseGetterSetter st = new ConfigurationContrywiseGetterSetter();

        try {
            while (xpp.getEventType() != XmlPullParser.END_DOCUMENT) {
                if (xpp.getEventType() == XmlPullParser.START_TAG) {

                    if (xpp.getName().equals("META_DATA")) {
                        st.setTable_CONFIGURATION_COUNTRY_WISE(xpp.nextText());
                    }
                    if (xpp.getName().equals("COUNTRY_ID")) {
                        st.setCOUNTRY_ID(xpp.nextText());
                    }
                    if (xpp.getName().equals("ADHOC_REPORTING")) {
                        st.setADHOC_REPORTING(xpp.nextText());
                    }

                    if (xpp.getName().equals("PDF_ALLOW")) {
                        st.setPDF_ALLOW(xpp.nextText());
                    }
                }
                xpp.next();
            }
        } catch (XmlPullParserException e) {
            e.printStackTrace();
        } catch (IOException e) {
            e.printStackTrace();
        }
        return st;
    }

    //NO_CAMERA_LAST_VISIT_DATA
    public static NoCameraLastVisitGetterSetter noCameraLastVisitXMLHandler(XmlPullParser xpp, int eventType) {
        NoCameraLastVisitGetterSetter st = new NoCameraLastVisitGetterSetter();

        try {
            while (xpp.getEventType() != XmlPullParser.END_DOCUMENT) {
                if (xpp.getEventType() == XmlPullParser.START_TAG) {

                    if (xpp.getName().equals("META_DATA")) {
                        st.setTable_NO_CAMERA_LAST_VISIT_DATA(xpp.nextText());
                    }
                    if (xpp.getName().equals("MID")) {
                        st.setMID(xpp.nextText());
                    }
                    if (xpp.getName().equals("STORE_ID")) {
                        st.setSTORE_ID(xpp.nextText());
                    }
                    if (xpp.getName().equals("VISIT_DATE")) {
                        st.setVISIT_DATE(xpp.nextText());
                    }
                    if (xpp.getName().equals("CATEGORY_ID")) {
                        st.setCATEGORY_ID(xpp.nextText());
                    }
                    if (xpp.getName().equals("SUB_CATEGORY_ID")) {
                        st.setSUB_CATEGORY_ID(xpp.nextText());
                    }
                    if (xpp.getName().equals("SKUGROUP_ID")) {
                        st.setSKUGROUP_ID(xpp.nextText());
                    }
                    if (xpp.getName().equals("ROW_NO")) {
                        st.setROW_NO(xpp.nextText());
                    }
                    if (xpp.getName().equals("COLUMN_NO")) {
                        st.setCOLUMN_NO(xpp.nextText());
                    }
                    if (xpp.getName().equals("FACING")) {
                        st.setFACING(xpp.nextText());
                    }
                    if (xpp.getName().equals("IS_VERTICAL")) {
                        st.setIS_VERTICAL(xpp.nextText());
                    }

                }
                xpp.next();
            }
        } catch (XmlPullParserException e) {
            e.printStackTrace();
        } catch (IOException e) {
            e.printStackTrace();
        }
        return st;
    }

    //GEO_FENCING
    public static GeoFencingGetterSetter geoFencingXMLHandler(XmlPullParser xpp, int eventType) {
        GeoFencingGetterSetter st = new GeoFencingGetterSetter();

        try {
            while (xpp.getEventType() != XmlPullParser.END_DOCUMENT) {
                if (xpp.getEventType() == XmlPullParser.START_TAG) {

                    if (xpp.getName().equals("META_DATA")) {
                        st.setTable_GEO_FENCING(xpp.nextText());
                    }
                    if (xpp.getName().equals("COUNTRY_ID")) {
                        st.setCOUNTRY_ID(xpp.nextText());
                    }
                    if (xpp.getName().equals("DISTANCE_MTR")) {
                        st.setDISTANCE_MTR(xpp.nextText());
                    }
                    if (xpp.getName().equals("GEO_FENCING")) {
                        st.setGEO_FENCING(xpp.nextText());
                    }
                }

                xpp.next();
            }
        } catch (XmlPullParserException e) {
            e.printStackTrace();
        } catch (IOException e) {
            e.printStackTrace();
        }
        return st;
    }

    // NON_WORKING_SUB_REASON XML HANDLER
    public static NonWorkingSubReasonGetterSetter nonWorkingSubReasonXMLHandler(XmlPullParser xpp,
                                                                                int eventType) {
        NonWorkingSubReasonGetterSetter reason = new NonWorkingSubReasonGetterSetter();

        try {
            while (xpp.getEventType() != XmlPullParser.END_DOCUMENT) {
                if (xpp.getEventType() == XmlPullParser.START_TAG) {
                    if (xpp.getName().equals("META_DATA")) {
                        reason.setTable_NON_WORKING_SUB_REASON(xpp.nextText());
                    }
                    if (xpp.getName().equals("REASON_ID")) {
                        reason.setREASON_ID(xpp.nextText());
                    }
                    if (xpp.getName().equals("SUB_REASON_ID")) {
                        reason.setSUB_REASON_ID(xpp.nextText());
                    }
                    if (xpp.getName().equals("SUB_REASON")) {
                        reason.setSUB_REASON(xpp.nextText());
                    }
                }
                xpp.next();
            }
        } catch (XmlPullParserException e) {

            e.printStackTrace();
        } catch (IOException e) {

            e.printStackTrace();
        }
        return reason;
    }

    //SUPERVISOR_LIST
    public static SupervisorListGetterSetter supervisorListXMLHandler(XmlPullParser xpp, int eventType) {
        SupervisorListGetterSetter st = new SupervisorListGetterSetter();

        try {
            while (xpp.getEventType() != XmlPullParser.END_DOCUMENT) {
                if (xpp.getEventType() == XmlPullParser.START_TAG) {

                    if (xpp.getName().equals("META_DATA")) {
                        st.setTable_SUPERVISOR_LIST(xpp.nextText());
                    }
                    if (xpp.getName().equals("COUNTRY_ID")) {
                        st.setCOUNTRY_ID(xpp.nextText());
                    }
                    if (xpp.getName().equals("EMP_ID")) {
                        st.setEMP_ID(xpp.nextText());
                    }
                    if (xpp.getName().equals("SUPERVISOR")) {
                        st.setSUPERVISOR(xpp.nextText());
                    }
                }

                xpp.next();
            }
        } catch (XmlPullParserException e) {
            e.printStackTrace();
        } catch (IOException e) {
            e.printStackTrace();
        }
        return st;
    }

    //CONFIGURATION_MASTER
    public static ConfigurationMasterGetterSetter configurationMasterXMLHandler(XmlPullParser xpp, int eventType) {
        ConfigurationMasterGetterSetter st = new ConfigurationMasterGetterSetter();

        try {
            while (xpp.getEventType() != XmlPullParser.END_DOCUMENT) {
                if (xpp.getEventType() == XmlPullParser.START_TAG) {

                    if (xpp.getName().equals("META_DATA")) {
                        st.setTable_CONFIGURATION_MASTER(xpp.nextText());
                    }
                    if (xpp.getName().equals("COUNTRY_ID")) {
                        st.setCOUNTRY_ID(xpp.nextText());
                    }
                    if (xpp.getName().equals("CONFIGURE")) {
                        st.setCONFIGURE(xpp.nextText());
                    }

                    if (xpp.getName().equals("ACTIVE")) {
                        st.setACTIVE(xpp.nextText());
                    }
                }
                xpp.next();
            }
        } catch (XmlPullParserException e) {
            e.printStackTrace();
        } catch (IOException e) {
            e.printStackTrace();
        }
        return st;
    }
}
