* @param filter the filter
* @return the JSON representation of the filter
* @throws Exception
*/
public static String stringifyFilter(final Filter filter) throws Exception {
JSONJAXBContext context =
new JSONJAXBContext(JSONConfiguration.natural().build(),
FilterModel.class);
JSONMarshaller marshaller = context.createJSONMarshaller();
StringWriter writer = new StringWriter();
marshaller.marshallToJSON(new FilterModel(filter), writer);
return writer.toString();
}