001package org.kuali.asr.handler;
002
003import org.kuali.ole.ncip.bo.OLERenewItem;
004import org.kuali.ole.ncip.bo.OLERenewItemList;
005import org.kuali.ole.ncip.converter.OLERenewItemConverter;
006
007/**
008 * Created by pvsubrah on 6/26/15.
009 */
010public class RenewItemResponseHandler extends ResponseHandler {
011
012    private OLERenewItemConverter oleRenewItemConverter;
013
014    public String marshalObjectToSIP2Xml(Object object) {
015        String renewItemXml = getOleRenewItemConverter().generateRenewItemListXmlForSip2((OLERenewItemList) object);
016        return renewItemXml;
017    }
018
019    @Override
020    public String marshalObjectToXml(Object object) {
021        String renewItemXml = getOleRenewItemConverter().generateRenewItemListXml((OLERenewItemList) object);
022        return renewItemXml;
023    }
024
025    @Override
026    public String marshalObjectToJson(Object object) {
027        return super.marshalObjectToJson(object);
028    }
029
030    private OLERenewItemConverter getOleRenewItemConverter() {
031        if (null == oleRenewItemConverter) {
032            oleRenewItemConverter = new OLERenewItemConverter();
033        }
034        return oleRenewItemConverter;
035    }
036}