com.atlassian.plugins.rest.common.json
Interface JaxbJsonMarshaller

All Known Implementing Classes:
DefaultJaxbJsonMarshaller

public interface JaxbJsonMarshaller

Utility service that will allow clients to marshall a Jaxb bean to Json using the same configuration that the REST module uses internally to create Json.

Since:
v1.0.2

Method Summary
 java.lang.String marshal(java.lang.Object jaxbBean)
          Given a jaxbBean this method will return a JSON string.
 java.lang.String marshal(java.lang.Object jaxbBean, java.lang.Class... jaxbClasses)
          Deprecated. since 1.1, use marshal(Object)
 

Method Detail

marshal

java.lang.String marshal(java.lang.Object jaxbBean)
                         throws JsonMarshallingException
Given a jaxbBean this method will return a JSON string.

Parameters:
jaxbBean - the bean to be converted to JSON
Returns:
a JSON string
Throws:
JsonMarshallingException - if any error occurs marshalling the JSON object
Since:
1.1

marshal

@Deprecated
java.lang.String marshal(java.lang.Object jaxbBean,
                                    java.lang.Class... jaxbClasses)
                         throws javax.xml.bind.JAXBException
Deprecated. since 1.1, use marshal(Object)

Given a jaxbBean and all the jaxb classes required to convert the bean to JSON this method will return a JSON string.

Parameters:
jaxbBean - the bean to be converted to JSON
jaxbClasses - the jaxb classes in use by the jaxb bean.
Returns:
a JSON string
Throws:
javax.xml.bind.JAXBException - if there's a problem marshalling the bean provided
Since:
1.0.2


Copyright © 2014 Atlassian. All Rights Reserved.