List of usage examples for com.mongodb.util ObjectSerializer serialize
String serialize(Object obj);
From source file:org.meta.api.ws.AbstractPluginWebServiceController.java
License:Open Source License
/** * Serialize as JSON the list of commands. * * @return a list of commands as JSON/*from w w w. jav a 2 s. c o m*/ */ public final String getJsonCommandList() { BasicBSONList list = new BasicBSONList(); for (Iterator<String> i = lstCommands.keySet().iterator(); i.hasNext();) { String key = (String) i.next(); list.add(key); } // Serialize BasicBSONList in JSON ObjectSerializer jsonSerializer = JSONSerializers.getStrict(); return jsonSerializer.serialize(list); }
From source file:org.meta.plugin.webservice.MetaWebServer.java
License:Open Source License
/** * <p>getPluginListAsJson</p> * * @return a plugin list as JSON/*w ww. j ava 2s . c om*/ */ public String getPluginListAsJson() { BasicBSONList list = new BasicBSONList(); for (Iterator<String> i = mapPlugins.keySet().iterator(); i.hasNext();) { String key = (String) i.next(); list.add(key); } // Serialize BasicBSONList in JSON ObjectSerializer jsonSerializer = JSONSerializers.getStrict(); return jsonSerializer.serialize(list); }