View Javadoc
1   package org.kuali.ole.docstore.common.exception;
2   
3   import com.thoughtworks.xstream.XStream;
4   
5   /**
6    * Created with IntelliJ IDEA.
7    * User: jayabharathreddy
8    * Date: 1/23/14
9    * Time: 7:36 PM
10   * To change this template use File | Settings | File Templates.
11   */
12  public class DocstoreExceptionProcessor {
13  
14      private static XStream xStream = getXstream();
15  
16      private static XStream getXstream() {
17          XStream xStream = new XStream();
18          xStream.alias("exception", DocstoreException.class);
19          return xStream;
20      }
21  
22      public static DocstoreException fromXML(String fileContent) {
23          return (DocstoreException) xStream.fromXML(fileContent);
24      }
25  
26      public static String toXml(DocstoreException docstoreException) {
27          return xStream.toXML(docstoreException);
28  
29      }
30  
31  
32  }