package kz.cafe.client;

import java.io.*;
import javax.xml.bind.*;

public abstract class JRAbstractRequest{

   @Override
   public String toString(){
      try{
         JAXBContext context = JAXBContext.newInstance(this.getClass());
         Marshaller marshaller = context.createMarshaller();

         marshaller.setProperty(Marshaller.JAXB_FRAGMENT, true);

         StringWriter sw = new StringWriter();

         marshaller.marshal(this, sw);

         return sw.toString();
      }
      catch (Throwable e){
         throw new Error("Can not marshall", e);
      }
   }
}
