1   package com.atlassian.plugins.rest.common.json;
2   
3   import javax.xml.bind.JAXBException;
4   
5   /**
6    * Utility service that will allow clients to marshall a Jaxb bean to Json using the same configuration that the REST
7    * module uses internally to create Json.
8    *
9    * @since v1.0.2
10   */
11  public interface JaxbJsonMarshaller
12  {
13  
14      /**
15       * Given a jaxbBean and all the jaxb classes required to convert the bean to JSON this method will return a JSON
16       * string.
17       *
18       * @param jaxbBean the bean to be converted to JSON
19       * @param jaxbClasses the jaxb classes in use by the jaxb bean.
20       * @return a JSON string
21       * @throws javax.xml.bind.JAXBException if there's a problem marshalling the bean provided
22       */
23      String marshal(Object jaxbBean, Class... jaxbClasses) throws JAXBException;
24  }