PageRenderTime 98ms queryTime 40ms sortTime 0ms getByIdsTime 58ms findMatchingLines 29ms

100+ results results for 'gson mongodb lang:java' (98 ms)

Not the results you expected?
QuestionDAOImpl.java https://bitbucket.org/itbelts/itbelts.git | Java | 106 lines
                    
16
                    
17import com.google.gson.reflect.TypeToken;
                    
18
                    
19/**
                    
20 * MongoDB implementation for the IQuestionDAO. <br>
                    
21 * <br>
                    
                
Operator.java https://github.com/LaMaldicionDeMandos/PersisterService.git | Java | 66 lines
                    
8import org.codehaus.jackson.map.ObjectMapper;
                    
9import org.pasut.persister.GsonMongoMapper;
                    
10
                    
10
                    
11import com.mongodb.BasicDBObject;
                    
12import com.mongodb.BasicDBObjectBuilder;
                    
16	
                    
17	private static final GsonMongoMapper wrapper = new GsonMongoMapper();
                    
18	private final ObjectMapper mapper = new ObjectMapper();
                    
                
MongoDBTask.java https://bitbucket.org/keypointt/foreveryoung.git | Java | 221 lines
                    
1package com.foreveryoung.mongodb;
                    
2
                    
17import com.foreveryoung.models.notices.Suggestion;
                    
18import com.foreveryoung.mongodb.RESTClient.RequestMethod;
                    
19import com.google.gson.JsonArray;
                    
19import com.google.gson.JsonArray;
                    
20import com.google.gson.JsonParser;
                    
21
                    
22/**
                    
23 * DB Operations class runs common operations on the mongoDB web server.
                    
24 * 
                    
27 */
                    
28public class MongoDBTask {
                    
29
                    
34
                    
35	protected MongoDBClient client;
                    
36
                    
                
TramStationGetterUtils.java https://bitbucket.org/ambientic/traveldashboard-server.git | Java | 40 lines
                    
7
                    
8import com.google.gson.Gson;
                    
9
                    
25		
                    
26		Gson gson = new Gson();
                    
27		String json = "null";
                    
30			//Paris
                    
31			json = gson.toJson(MongoDbManager.getParisTramStationsCollection(latitude, longitude, radius));
                    
32		} 
                    
                
SearchServiceImpl.java https://gitlab.com/Aaeinstein54/corelib | Java | 1063 lines
                    
22import com.google.common.hash.Hashing;
                    
23import com.google.gson.Gson;
                    
24import com.google.gson.reflect.TypeToken;
                    
24import com.google.gson.reflect.TypeToken;
                    
25import com.mongodb.BasicDBObject;
                    
26import com.mongodb.DB;
                    
26import com.mongodb.DB;
                    
27import com.mongodb.DBCollection;
                    
28import com.mongodb.DBCursor;
                    
37import eu.europeana.corelib.definitions.solr.model.Term;
                    
38import eu.europeana.corelib.edm.exceptions.MongoDBException;
                    
39import eu.europeana.corelib.edm.exceptions.SolrTypeException;
                    
140    public FullBean findById(String collectionId, String recordId,
                    
141                             boolean similarItems) throws MongoDBException {
                    
142        return findById(EuropeanaUriUtils.createEuropeanaId(collectionId, recordId),
                    
                
RecommendNewMaterialCommand.java https://bitbucket.org/abdelrahmanrustom/searchengine.git | Java | 137 lines
                    
1import com.google.gson.Gson;
                    
2import com.google.gson.JsonObject;
                    
3import com.mongodb.MongoClient;
                    
4import com.mongodb.MongoClientURI;
                    
5import com.mongodb.client.FindIterable;
                    
102            resJson.put("results", json_search_responses);
                    
103            Gson json = new Gson();
                    
104            res[0] = json.toJson(resJson);
                    
108            resJson.put("error", e.toString());
                    
109            Gson json = new Gson();
                    
110            res[0] = json.toJson(resJson);
                    
122//                resJson.put("results", json_search_responses);
                    
123//                Gson json = new Gson();
                    
124//                res[0] = json.toJson(resJson);
                    
129//                resJson.put("error", e.toString());
                    
130//                Gson json = new Gson();
                    
131//                res[0] = json.toJson(resJson);
                    
                
EGATSProcess.java https://github.com/augie/egats.git | Java | 479 lines
                    
2
                    
3import com.mongodb.BasicDBList;
                    
4import com.mongodb.DBObject;
                    
4import com.mongodb.DBObject;
                    
5import com.mongodb.util.JSON;
                    
6import java.io.File;
                    
65                        EGATSObject o = EGATSObject.CACHE.get(mArgs[i].replaceFirst("egats-obj-file:", ""));
                    
66                        EGATSObjectFile of = Data.GSON.fromJson(o.getObject(), EGATSObjectFile.class);
                    
67                        File file = server.getWorkFileManager().getFile(o, of);
                    
156                    argCObjs[i] = server.getToolkit().getClass(classPath);
                    
157                    argObjs[i] = argCObjs[i].cast(Data.GSON.fromJson(argEObjs[i].getObject(), argCObjs[i]));
                    
158                }
                    
171                o.setClassPath(method.getReturnType().getName());
                    
172                o.setObject(Data.GSON.toJson(output));
                    
173                // Save it
                    
                
API.java https://github.com/augie/egats.git | Java | 572 lines
                    
2
                    
3import com.mongodb.util.JSON;
                    
4import java.io.IOException;
                    
270        egatsObject.setClassPath(EGATSObjectFile.class.getName());
                    
271        egatsObject.setObject(Data.GSON.toJson(egatsObjectFile));
                    
272        return createObject(egatsObject);
                    
                
Database.java https://gitlab.com/goolic/MuninMX | Java | 591 lines
                    
44import static com.clavain.utils.Quartz.scheduleCustomIntervalJob;
                    
45import com.google.gson.Gson;
                    
46import com.google.gson.GsonBuilder;
                    
46import com.google.gson.GsonBuilder;
                    
47import com.mongodb.BasicDBObject;
                    
48import com.mongodb.DB;
                    
48import com.mongodb.DB;
                    
49import com.mongodb.DBCollection;
                    
50import com.mongodb.WriteConcern;
                    
113        try {
                    
114         Gson gson = new GsonBuilder().excludeFieldsWithModifiers(Modifier.TRANSIENT).create();
                    
115         String json = gson.toJson(p_analyzer);
                    
240            {
                    
241                Gson gson = new Gson();
                    
242                sc = gson.fromJson(rs.getString("json"), ServiceCheck.class);
                    
                
muninmxcd.java https://gitlab.com/goolic/MuninMX | Java | 407 lines
                    
37import com.clavain.checks.ReturnDebugTrace;
                    
38import com.mongodb.BasicDBObject;
                    
39import com.mongodb.DB;
                    
39import com.mongodb.DB;
                    
40import com.mongodb.DBCollection;
                    
41import com.mongodb.MongoClient;
                    
41import com.mongodb.MongoClient;
                    
42import com.mongodb.MongoClientOptions;
                    
43import com.mongodb.ServerAddress;
                    
84import com.clavain.workers.ErrorNotifyExecutor;
                    
85import com.google.gson.Gson;
                    
86import java.util.List;
                    
289            {
                    
290                Gson gson = new Gson();
                    
291                ServiceCheck tc = gson.fromJson(rs.getString("json"), ServiceCheck.class);
                    
                
CommunityDAOImpl.java https://bitbucket.org/itbelts/itbelts.git | Java | 49 lines
                    
9
                    
10import com.google.gson.reflect.TypeToken;
                    
11
                    
12/**
                    
13 *  MongoDB implementation for the ICommunityDAO.
                    
14 * <br><br>
                    
                
HistoryController.java git://github.com/johanlindquist/jahspotify.git | Java | 126 lines
                    
26
                    
27import com.google.gson.Gson;
                    
28import jahspotify.storage.statistics.*;
                    
41    @Autowired
                    
42    @Qualifier(value = "mongodb")
                    
43    private HistoricalStorage _historicalStorage;
                    
70            {
                    
71                Gson gson = new Gson();
                    
72
                    
78                    TrackHistory next = iterator.next();
                    
79                    outputStream.write(gson.toJson(toWebTrack(next)));
                    
80                    if (iterator.hasNext())
                    
89                {
                    
90                    outputStream.write(gson.toJson(toWebTrack(historyCursor.next())));
                    
91                    if (historyCursor.hasNext())
                    
                
TubeStatusGetterUtils.java https://bitbucket.org/ambientic/traveldashboard-server.git | Java | 33 lines
                    
5
                    
6import com.google.gson.Gson;
                    
7
                    
22
                    
23		Gson gson = new Gson();
                    
24		
                    
24		
                    
25		String json = gson.toJson(MongoDbManager.getMetroStatus(city, routeId));		
                    
26		
                    
                
IndexController.java https://bitbucket.org/ericson_cepeda/repbiblioteca.git | Java | 42 lines
                    
7
                    
8import com.google.gson.JsonObject;
                    
9import comparacion.Comparador;
                    
37        //response.put( "booksQuantity", ser.getObjetoBiblioteca( ).size( ) );
                    
38        //response.put( "statsDB", connector.getMongoDB( ).getStats( ).toMap( ) );
                    
39        
                    
                
TubeCommentGetterUtils.java https://bitbucket.org/ambientic/traveldashboard-server.git | Java | 34 lines
                    
4
                    
5import com.google.gson.Gson;
                    
6
                    
23		
                    
24		Gson gson = new Gson();
                    
25		String json = gson.toJson(MongoDbManager.getMetroCommentsCollection(city, stopId, routeId, maxComments));
                    
                
MongoDBHistoryCursor.java git://github.com/johanlindquist/jahspotify.git | Java | 63 lines
                    
21
                    
22import com.google.gson.Gson;
                    
23import com.mongodb.DBCursor;
                    
23import com.mongodb.DBCursor;
                    
24import com.mongodb.util.JSON;
                    
25
                    
28 */
                    
29public class MongoDBHistoryCursor implements HistoryCursor
                    
30{
                    
32    private DBCursor _dbObjects;
                    
33    private static Gson _gson = new Gson();
                    
34    
                    
34    
                    
35    MongoDBHistoryCursor(final DBCursor dbObjects)
                    
36    {
                    
                
BusStopGetterUtils.java https://bitbucket.org/ambientic/traveldashboard-server.git | Java | 100 lines
                    
8
                    
9import com.google.gson.Gson;
                    
10
                    
28		
                    
29		Gson gson = new Gson();
                    
30		String json = "null";
                    
35			
                    
36			BusStationsCollection collection = MongoDbManager.getLondonBusStationsCollection(latitude, longitude, radius);
                    
37			
                    
41			
                    
42			json = gson.toJson(collection);
                    
43			
                    
73		
                    
74		Gson gson = new Gson();
                    
75		String json = "null";
                    
                
ServerTest.java https://github.com/augie/egats.git | Java | 137 lines
                    
2
                    
3import com.mongodb.util.JSON;
                    
4import java.util.LinkedList;
                    
37        arg1Obj.setClassPath(arg1.getClass().getName());
                    
38        arg1Obj.setObject(Data.GSON.toJson(arg1));
                    
39        arg1Obj = EGATSObject.create(Data.GSON.toJson(arg1Obj));
                    
43        arg2Obj.setClassPath(arg2.getClass().getName());
                    
44        arg2Obj.setObject(Data.GSON.toJson(arg2));
                    
45        arg2Obj = EGATSObject.create(Data.GSON.toJson(arg2Obj));
                    
80        // Is the output from the process as expected?
                    
81        assertEquals(Data.GSON.toJson(expectedOutput), o.getObject());
                    
82    }
                    
93        arg1Obj.setClassPath(arg1.getClass().getName());
                    
94        arg1Obj.setObject(Data.GSON.toJson(arg1));
                    
95        arg1Obj = EGATSObject.create(Data.GSON.toJson(arg1Obj));
                    
                
IMPPlugin.java https://bitbucket.org/jyc/imp | Java | 146 lines
                    
46        if (!(JarLibLoader.load(
                    
47                    new File("./lib/gson-1.7.1.jar"),
                    
48                    new String[] { "com.google.gson" })
                    
53                        new File("./lib/mongo-2.6.5.jar"),
                    
54                        new String[] { "com.mongodb" })
                    
55                && JarLibLoader.load(
                    
                
DataSourceConfigurationVO.java https://bitbucket.org/piyushgd10/bhumi.git | Java | 446 lines
                    
9
                    
10import com.google.gson.Gson;
                    
11import org.springframework.data.annotation.Id;
                    
11import org.springframework.data.annotation.Id;
                    
12import org.springframework.data.mongodb.core.index.CompoundIndex;
                    
13import org.springframework.data.mongodb.core.index.CompoundIndexes;
                    
13import org.springframework.data.mongodb.core.index.CompoundIndexes;
                    
14import org.springframework.data.mongodb.core.index.Indexed;
                    
15import org.springframework.data.mongodb.core.mapping.Document;
                    
443        d.setConnectionProperties("");
                    
444        System.out.println(new Gson().toJson(d));
                    
445    }
                    
                
CourseDAOImpl.java https://bitbucket.org/itbelts/itbelts.git | Java | 78 lines
                    
13
                    
14import com.google.gson.reflect.TypeToken;
                    
15
                    
16/**
                    
17 * MongoDB implementation for the ICourseDAO. <br>
                    
18 * <br>
                    
                
IncentiveGetterUtils.java https://bitbucket.org/ambientic/traveldashboard-server.git | Java | 96 lines
                    
9
                    
10import com.google.gson.Gson;
                    
11
                    
27		
                    
28		Gson gson = new Gson();
                    
29
                    
36				//Get london tube station fact
                    
37				json = gson.toJson(MongoDbManager.getLondonTubeStationFact(stopId));
                    
38			} else {
                    
40				Incentive parisFact = new Incentive(stopId,
                    
41						MongoDbManager.getParisMetroStationName(stopId),
                    
42						IncentiveType.FACT, 
                    
67					//Get london tube station static joke
                    
68					json = gson.toJson(MongoDbManager.getLondonTubeStationJoke(stopId));
                    
69				} else {
                    
                
GsonMongoMapper.java https://github.com/LaMaldicionDeMandos/PersisterService.git | Java | 66 lines
                    
13
                    
14import com.mongodb.BasicDBObject;
                    
15import com.mongodb.DBObject;
                    
16
                    
17public class GsonMongoMapper extends GsonMapper implements MongoMapper {
                    
18	private final ObjectMapper mapper = new ObjectMapper();
                    
                
NoiseGetterUtils.java https://bitbucket.org/ambientic/traveldashboard-server.git | Java | 50 lines
                    
6
                    
7import com.google.gson.Gson;
                    
8
                    
39		
                    
40		Gson gson = new Gson();
                    
41
                    
41
                    
42		String json = gson.toJson(MongoDbManager.getMetroNoiseDatasCollection(city, stopId, routeId, timestamp, interval));
                    
43		
                    
                
IndexController.java https://bitbucket.org/ericson_cepeda/repbiblioteca.git | Java | 69 lines
                    
10
                    
11import com.google.gson.Gson;
                    
12import com.google.gson.JsonObject;
                    
12import com.google.gson.JsonObject;
                    
13import com.mongodb.BasicDBObject;
                    
14import com.mongodb.DBObject;
                    
14import com.mongodb.DBObject;
                    
15import com.mongodb.util.JSON;
                    
16
                    
20        Serializacion ser = Serializacion.getInstance( );
                    
21        return ser.getGsonBiblioteca( ).toJson(ser.getObjetoBiblioteca().get(Integer.parseInt(index)));
                    
22    }
                    
36        BasicDBObject responseObject = new BasicDBObject();
                    
37        Gson gson = Serializacion.getInstance().getGsonBiblioteca();
                    
38        List<DBObject> libraryIndexed = IndexLibrary.getIndexBookByTitle(title);
                    
                
Fqn.java https://github.com/bleujin/mongoNode.git | Java | 368 lines
                    
8
                    
9import net.ion.framework.parse.gson.JsonPrimitive;
                    
10import net.ion.framework.util.MapUtil;
                    
17import com.google.common.collect.Iterables;
                    
18import com.mongodb.BasicDBObject;
                    
19import com.mongodb.DBObject;
                    
                
AllTubeRatingGetterUtils.java https://bitbucket.org/ambientic/traveldashboard-server.git | Java | 31 lines
                    
4
                    
5import com.google.gson.Gson;
                    
6
                    
20		
                    
21		Gson gson = new Gson();
                    
22		
                    
22		
                    
23		String json = gson.toJson(MongoDbManager.getMetroGeneralRatingsCollection(city));
                    
24		
                    
                
TubeRatingGetterUtils.java https://bitbucket.org/ambientic/traveldashboard-server.git | Java | 33 lines
                    
4
                    
5import com.google.gson.Gson;
                    
6
                    
21		
                    
22		Gson gson = new Gson();
                    
23		String json = "null";
                    
24
                    
25		json = gson.toJson(MongoDbManager.getMetroGeneralRating(city, routeId));
                    
26
                    
                
MetroClassifiedCrowdGetterUtils.java https://bitbucket.org/ambientic/traveldashboard-server.git | Java | 48 lines
                    
7
                    
8import com.google.gson.Gson;
                    
9
                    
38		
                    
39		Gson gson = new Gson();
                    
40		String json = gson.toJson(MongoDbManager.getMetroClassifiedCrowd(city, stopId, routeId, timestamp));
                    
                
MetroGeneralCrowdGetterUtils.java https://bitbucket.org/ambientic/traveldashboard-server.git | Java | 53 lines
                    
6
                    
7import com.google.gson.Gson;
                    
8
                    
39		
                    
40		Gson gson = new Gson();
                    
41		
                    
42		//Get crowd data until interval ago
                    
43		//String json = gson.toJson(MongoDbManager.getMetroGeneralCrowd(city, stopId, routeId, timestamp, interval));
                    
44		//Get crowd data until 6 times interval ago
                    
44		//Get crowd data until 6 times interval ago
                    
45		String json = gson.toJson(MongoDbManager.getMetroGeneralCrowdCollection(city, stopId, routeId, timestamp, interval));
                    
46		
                    
                
Data.java https://github.com/augie/egats.git | Java | 58 lines
                    
2
                    
3import com.google.gson.Gson;
                    
4import com.mongodb.DB;
                    
4import com.mongodb.DB;
                    
5import com.mongodb.DBCollection;
                    
6import com.mongodb.Mongo;
                    
6import com.mongodb.Mongo;
                    
7import com.mongodb.WriteResult;
                    
8
                    
15    private static int TEST_ID = 0;
                    
16    public static final Gson GSON = new Gson();
                    
17    public static Mongo MONGO;
                    
                
StorageManager.java https://gitlab.com/rjschu/wheres-my-bus-.git | Java | 101 lines
                    
8import co.uk.wmb.model.RouteList;
                    
9import co.uk.wmb.util.GsonUtils;
                    
10
                    
11import com.google.common.collect.Lists;
                    
12import com.mongodb.CommandResult;
                    
13
                    
26	public void insertOrUpdateBus(Bus bus) {
                    
27		String jsonBus = GsonUtils.toJson(bus);
                    
28		database.insert(jsonBus, Collection.BUS);
                    
32		if (route.getStops() != null) {
                    
33			String jsonBus = GsonUtils.toJson(route);
                    
34			database.insert(jsonBus, Collection.BUS_STOP);
                    
40	public void insertOrUpdateRouteList(RouteList routeList) {
                    
41		String jsonBus = GsonUtils.toJson(routeList);
                    
42		database.insert(jsonBus, Collection.ROUTE_LIST);
                    
                
UserDAOImpl.java https://bitbucket.org/itbelts/itbelts.git | Java | 56 lines
                    
9
                    
10import com.google.gson.reflect.TypeToken;
                    
11
                    
12/**
                    
13 *  MongoDB implementation for the IUserDAO.
                    
14 * <br><br>
                    
                
SpecialtyDAOImpl.java https://bitbucket.org/itbelts/itbelts.git | Java | 55 lines
                    
9
                    
10import com.google.gson.reflect.TypeToken;
                    
11
                    
12/**
                    
13 *  MongoDB implementation for the ISpecialtyDAO.
                    
14 * <br><br>
                    
                
TopicDAOImpl.java https://bitbucket.org/itbelts/itbelts.git | Java | 63 lines
                    
9
                    
10import com.google.gson.reflect.TypeToken;
                    
11
                    
12/**
                    
13 *  MongoDB implementation for the ITopicDAO.
                    
14 * <br><br>
                    
                
Books.java https://bitbucket.org/ericson_cepeda/repbiblioteca.git | Java | 173 lines
                    
6
                    
7import com.google.gson.Gson;
                    
8import com.google.gson.JsonObject;
                    
8import com.google.gson.JsonObject;
                    
9import com.mongodb.BasicDBObject;
                    
10import com.mongodb.DB;
                    
10import com.mongodb.DB;
                    
11import com.mongodb.DBCollection;
                    
12import com.mongodb.DBObject;
                    
12import com.mongodb.DBObject;
                    
13import com.mongodb.util.JSON;
                    
14
                    
122        DBCollection booksCollection = bdConex.getCollection( MongoConnector.BOOKS_COLLECTION );
                    
123        Gson json = new Gson( );
                    
124        Object obj = JSON.parse( json.toJson( newBook ) );
                    
                
UserRatingGetterUtils.java https://bitbucket.org/ambientic/traveldashboard-server.git | Java | 34 lines
                    
4
                    
5import com.google.gson.Gson;
                    
6
                    
22		
                    
23		Gson gson = new Gson();
                    
24		
                    
24		
                    
25		String json = gson.toJson(MongoDbManager.getMetroUserRating(city, username, routeId));
                    
26		
                    
                
TodoDAOImpl.java https://bitbucket.org/itbelts/itbelts.git | Java | 82 lines
                    
9
                    
10import com.google.gson.reflect.TypeToken;
                    
11
                    
12/**
                    
13 * MongoDB implementation for the ITodoDAO. <br>
                    
14 * <br>
                    
                
Contact.java https://bitbucket.org/pepo77/solstice-api.git | Java | 200 lines
                    
3import com.google.common.base.Strings;
                    
4import com.google.gson.JsonObject;
                    
5import exceptions.EmptyParametersException;
                    
7import org.joda.time.format.DateTimeFormatter;
                    
8import org.mongodb.morphia.annotations.Entity;
                    
9import play.data.validation.Email;
                    
                
MongoDBMediaStorage.java git://github.com/johanlindquist/jahspotify.git | Java | 211 lines
                    
4
                    
5import com.google.gson.Gson;
                    
6import com.mongodb.*;
                    
6import com.mongodb.*;
                    
7import com.mongodb.util.JSON;
                    
8import jahspotify.media.*;
                    
16@Service
                    
17@Qualifier(value = "mongodb")
                    
18public class MongoDBMediaStorage implements MediaStorage
                    
19{
                    
20    private Log _log = LogFactory.getLog(MongoDBMediaStorage.class);
                    
21
                    
21
                    
22    @Value(value = "${jahspotify.storage.mongodb.host}")
                    
23    private String _dbHost = "localhost";
                    
                
Publication.java https://bitbucket.org/marcosflorez/mvp | Java | 264 lines
                    
3import com.amazonaws.util.json.JSONObject;
                    
4import com.google.gson.Gson;
                    
5import com.google.gson.JsonElement;
                    
5import com.google.gson.JsonElement;
                    
6import com.google.gson.JsonObject;
                    
7import com.mongodb.BasicDBObject;
                    
7import com.mongodb.BasicDBObject;
                    
8import com.mongodb.DBObject;
                    
9import models.Review;
                    
255
                    
256        return com.mongodb.util.JSON.serialize(this.toDBO());
                    
257    }
                    
                
ClassifiedNoiseGetterUtils.java https://bitbucket.org/ambientic/traveldashboard-server.git | Java | 49 lines
                    
6
                    
7import com.google.gson.Gson;
                    
8
                    
38		
                    
39		Gson gson = new Gson();
                    
40
                    
40
                    
41		String json = gson.toJson(MongoDbManager.getMetroClassifiedNoise(city, stopId, routeId, timestamp));
                    
42		
                    
                
ExamDAOImpl.java https://bitbucket.org/itbelts/itbelts.git | Java | 78 lines
                    
13
                    
14import com.google.gson.reflect.TypeToken;
                    
15
                    
16/**
                    
17 * MongoDB implementation for the IExamDAO. <br>
                    
18 * <br>
                    
                
MongoUtils.java https://github.com/agirbal/umongo.git | Java | 271 lines
                    
17
                    
18import com.google.gson.Gson;
                    
19import com.google.gson.GsonBuilder;
                    
19import com.google.gson.GsonBuilder;
                    
20import com.google.gson.JsonParser;
                    
21import com.mongodb.*;
                    
21import com.mongodb.*;
                    
22import com.mongodb.util.JSONSerializers;
                    
23import com.mongodb.util.ObjectSerializer;
                    
263    
                    
264    private static Gson gson;
                    
265    public static Gson getGson() {
                    
266        if (gson == null) {
                    
267            gson = new GsonBuilder().setPrettyPrinting().disableHtmlEscaping().create();
                    
268        }
                    
                
AllTubeStatusGetterUtils.java https://bitbucket.org/ambientic/traveldashboard-server.git | Java | 33 lines
                    
4
                    
5import com.google.gson.Gson;
                    
6
                    
19		
                    
20		Gson gson = new Gson();
                    
21		
                    
23
                    
24		json = gson.toJson(MongoDbManager.getMetroStatusCollection(city));
                    
25
                    
                
Comparador.java https://bitbucket.org/ericson_cepeda/repbiblioteca.git | Java | 218 lines
                    
12
                    
13import com.google.gson.Gson;
                    
14import com.mongodb.DBObject;
                    
14import com.mongodb.DBObject;
                    
15import com.mongodb.util.JSON;
                    
16
                    
23
                    
24    private static Gson gson;
                    
25    
                    
30        rtaLibreria= new ArrayList<DtoRespuesta>( );
                    
31        gson = new Gson( );
                    
32
                    
46    {
                    
47        Gson gson = new Gson( );
                    
48        List<Books> listaRespuesta = new ArrayList<Books>( );
                    
                
UserExamDAOImpl.java https://bitbucket.org/itbelts/itbelts.git | Java | 55 lines
                    
9
                    
10import com.google.gson.reflect.TypeToken;
                    
11
                    
12/**
                    
13 * MongoDB implementation for the IUserExamDAO. <br>
                    
14 * <br>
                    
                
Serializacion.java https://bitbucket.org/ericson_cepeda/repbiblioteca.git | Java | 320 lines
                    
13
                    
14import com.google.gson.Gson;
                    
15import com.google.gson.JsonElement;
                    
15import com.google.gson.JsonElement;
                    
16import com.mongodb.DBObject;
                    
17
                    
25
                    
26    private Gson gsonBiblioteca;
                    
27
                    
36    	posicion = 0;
                    
37        gsonBiblioteca = new Gson( );
                    
38        objetoBiblioteca = new ArrayList<BibliotecaTDO>( );
                    
46    
                    
47    public Gson getGsonBiblioteca( )
                    
48    {
                    
                
SetZGram.java https://gitlab.com/BGCX261/zonales-svn-to-git.git | Java | 72 lines
                    
6
                    
7import com.google.gson.Gson;
                    
8import org.zonales.BaseService;
                    
8import org.zonales.BaseService;
                    
9import com.mongodb.MongoException;
                    
10import java.io.IOException;
                    
42        ZGram zgram = new ZGram();        
                    
43        Gson metadataGson = new Gson();
                    
44        ZMessage zMessage = new ZMessage(cod, msg);
                    
46        //Mapeo en un objeto ZCrawling la metadata que vienen en formato JSON en el request
                    
47        zgram = metadataGson.fromJson(metadataJson.replace("\\\"", "\"").replace("\\'", "\""), ZGram.class);
                    
48        zgram.setVerbatim(verbatim);
                    
                
BikeGetterUtils.java https://bitbucket.org/ambientic/traveldashboard-server.git | Java | 36 lines
                    
4
                    
5import com.google.gson.Gson;
                    
6
                    
26		
                    
27		Gson gson = new Gson();
                    
28		String json = gson.toJson(MongoDbManager.getBikeStationsCollection(latitude, longitude, radius));
                    
                
UserCommentGetterUtils.java https://bitbucket.org/ambientic/traveldashboard-server.git | Java | 34 lines
                    
4
                    
5import com.google.gson.Gson;
                    
6
                    
24		
                    
25		Gson gson = new Gson();
                    
26		String json = gson.toJson(MongoDbManager.getMetroCommentsCollectionForUser(city, userName, stopId, routeId, maxComments));
                    
                
TemplateCustomizationFieldsVO.java https://bitbucket.org/piyushgd10/bhumi.git | Java | 638 lines
                    
16import org.springframework.data.annotation.Id;
                    
17import org.springframework.data.mongodb.core.mapping.Document;
                    
18
                    
18
                    
19import com.google.gson.Gson;
                    
20
                    
                
AllUserRatingGetterUtils.java https://bitbucket.org/ambientic/traveldashboard-server.git | Java | 30 lines
                    
4
                    
5import com.google.gson.Gson;
                    
6
                    
20		
                    
21		Gson gson = new Gson();
                    
22		String json = gson.toJson(MongoDbManager.getMetroUserRatingsCollection(city, username));
                    
                
ExampleFactory.java https://github.com/LaMaldicionDeMandos/PersisterService.git | Java | 44 lines
                    
8
                    
9import com.mongodb.BasicDBList;
                    
10import com.mongodb.BasicDBObject;
                    
10import com.mongodb.BasicDBObject;
                    
11import com.mongodb.DBObject;
                    
12
                    
13public class ExampleFactory {
                    
14	private final GsonMongoMapper mapper = new GsonMongoMapper();
                    
15	
                    
                
TubeStationGetterUtils.java https://bitbucket.org/ambientic/traveldashboard-server.git | Java | 43 lines
                    
7
                    
8import com.google.gson.Gson;
                    
9
                    
25		
                    
26		Gson gson = new Gson();
                    
27		String json = "null";
                    
30			//Paris
                    
31			json = gson.toJson(MongoDbManager.getParisMetroStationsCollection(latitude, longitude, radius));
                    
32		} else {
                    
33			//London
                    
34			json = gson.toJson(MongoDbManager.getLondonMetroStationsCollection(latitude, longitude, radius));
                    
35		}
                    
                
GenericDao.java https://bitbucket.org/hbhackathon/travelplace.git | Java | 63 lines
                    
2
                    
3import com.google.gson.Gson;
                    
4import com.hackatravel.travelplace.model.ModelItem;
                    
4import com.hackatravel.travelplace.model.ModelItem;
                    
5import com.mongodb.client.FindIterable;
                    
6import com.mongodb.client.MongoCollection;
                    
6import com.mongodb.client.MongoCollection;
                    
7import com.mongodb.client.MongoDatabase;
                    
8import org.bson.Document;
                    
20
                    
21    private Gson gson = new Gson();
                    
22
                    
34            String documentString = document.toJson();
                    
35            T object = gson.fromJson(documentString, clazz);
                    
36            result.add(object);
                    
                
MongoPersisterService.java https://github.com/LaMaldicionDeMandos/PersisterService.git | Java | 108 lines
                    
7
                    
8import com.mongodb.BasicDBObjectBuilder;
                    
9import com.mongodb.DB;
                    
9import com.mongodb.DB;
                    
10import com.mongodb.DBCollection;
                    
11import com.mongodb.DBObject;
                    
11import com.mongodb.DBObject;
                    
12import com.mongodb.Mongo;
                    
13
                    
16	private final DB db;
                    
17	private final GsonMongoMapper mapper = new GsonMongoMapper();
                    
18	private final ExampleFactory factory = new ExampleFactory();
                    
                
TodoService.java https://gitlab.com/vsailakshmi/todoapp-spark | Java | 49 lines
                    
2
                    
3import com.google.gson.Gson;
                    
4import com.mongodb.*;
                    
35    public void createNewTodo(String body) {
                    
36        Todo todo = new Gson().fromJson(body, Todo.class);
                    
37        collection.insert(new BasicDBObject("title", todo.getTitle()).append("done", todo.isDone()).append("createdOn", new Date()));
                    
44    public Todo update(String todoId, String body) {
                    
45        Todo todo = new Gson().fromJson(body, Todo.class);
                    
46        collection.update(new BasicDBObject("_id", new ObjectId(todoId)), new BasicDBObject("$set", new BasicDBObject("done", todo.isDone())));
                    
                
BaseApiPojo.java https://github.com/IKANOW/Infinit.e.git | Java | 284 lines
                    
24import org.bson.types.ObjectId;
                    
25import com.google.gson.GsonBuilder;
                    
26import com.google.gson.JsonArray;
                    
29import com.google.gson.JsonElement;
                    
30import com.google.gson.JsonParseException;
                    
31import com.google.gson.JsonPrimitive;
                    
41	// Override this function to perform custom serialization (see BasePojoApiMap)
                    
42	public GsonBuilder extendBuilder(GsonBuilder gp) {
                    
43		return extendBuilder_internal(gp);
                    
46	final public static GsonBuilder getDefaultBuilder() {
                    
47		GsonBuilder gb = 
                    
48			new GsonBuilder()
                    
56	}
                    
57	private static GsonBuilder extendBuilder_internal(GsonBuilder gp) {
                    
58		return gp;
                    
                
HospitalServiceImpl.java https://bitbucket.org/dkhaliunaa/mal-emneleg.git | Java | 6998 lines
                    
4import com.enumclass.ErrorType;
                    
5import com.google.gson.internal.LinkedTreeMap;
                    
6import com.hospital.app.*;
                    
10import com.model.hos.*;
                    
11import com.mongodb.BasicDBObject;
                    
12import com.rpc.RpcHandler;
                    
                
TwitchAnnouncement.java https://bitbucket.org/wuffy-official/bot.git | Java | 172 lines
                    
10
                    
11import com.mongodb.client.MongoCollection;
                    
12import com.mongodb.client.model.UpdateOneModel;
                    
12import com.mongodb.client.model.UpdateOneModel;
                    
13import com.mongodb.client.model.WriteModel;
                    
14
                    
15import net.wuffy.common.logger.Logger;
                    
16import net.wuffy.common.util.GsonUtil;
                    
17import net.wuffy.core.twitch.TwitchAPI;
                    
94
                    
95					//Update started_at to mongodb
                    
96					writeModels.add(new UpdateOneModel<Document>(
                    
138		for(Document document : documents) {
                    
139			Message message = GsonUtil.GSON.fromJson(document.toJson(), Message.class);
                    
140
                    
                
ZMessages.java https://gitlab.com/BGCX261/zonales-svn-to-git.git | Java | 111 lines
                    
39            case 302:
                    
40                return MONGODB_ERROR;
                    
41            case 303:
                    
69            case 390:
                    
70                return GSON_CONVERTION_ERROR;
                    
71            case 400:
                    
92    public static final ZMessage NO_DB_FAILED = new ZMessage(301, "DB is unavailable");
                    
93    public static final ZMessage MONGODB_ERROR = new ZMessage(302, "MongoDB error");
                    
94    public static final ZMessage CONN_ERROR = new ZMessage(303, "Connection error");
                    
107    public static final ZMessage ZSERVLETS_CONN_ERROR = new ZMessage(380, "ZServlet - Error de conección");
                    
108    public static final ZMessage GSON_CONVERTION_ERROR = new ZMessage(390, "GSon - Error de Conversión");
                    
109    public static final ZMessage FACEBOOK_GENERAL_ERROR = new ZMessage(400, "Facebook Information Retrieval - Error no identificado");
                    
                
UpdateZGram.java https://gitlab.com/BGCX261/zonales-svn-to-git.git | Java | 115 lines
                    
6
                    
7import com.google.gson.Gson;
                    
8import org.zonales.BaseService;
                    
8import org.zonales.BaseService;
                    
9import com.mongodb.MongoException;
                    
10import java.io.IOException;
                    
43
                    
44        Gson metadataGson = new Gson();     
                    
45
                    
50        if (metadataJson != null) {
                    
51            zgram = metadataGson.fromJson(metadataJson.replace("\\\"", "\""), ZGram.class);
                    
52            Logger.getLogger(this.getClass().getName()).log(Level.INFO, "Metadata {0}", new Object[]{metadataJson});
                    
54            String zgramJson = zGramDao.retrieveJson(id);
                    
55            zgram = metadataGson.fromJson(zgramJson, ZGram.class);
                    
56            Logger.getLogger(this.getClass().getName()).log(Level.INFO, "=====>> ZGRAM: {0}", new Object[]{metadataJson});
                    
                
CourseLoaderTest.java https://gitlab.com/soylentcode/halleck.git | Java | 43 lines
                    
4import com.google.common.collect.Iterables;
                    
5import com.google.gson.Gson;
                    
6import halleck.lms.Course;
                    
12import static com.google.common.collect.Lists.newArrayList;
                    
13import static com.mongodb.util.MyAsserts.assertEquals;
                    
14import static halleck.lms.Utils.toInteger;
                    
17    @Test
                    
18    public void testGSonStuff() throws Exception {
                    
19        CourseLoader l = new CourseLoader(null, null, null);
                    
29        ArrayList<Course> sourceList = newArrayList(source);
                    
30        String content = new Gson().toJson(sourceList);
                    
31        Collection<Course> courses = l.createCourseArray(content);
                    
                
RegDumpModel.java https://bitbucket.org/deepakjangir07/shine.com.git | Java | 79 lines
                    
2
                    
3import com.google.gson.annotations.SerializedName;
                    
4
                    
19// "skills":[{"name":"Python","experience":4,"id":4096},{"name":"Django","experience":4,"id":4097},
                    
20// {"name":"MongoDB","experience":4,"id":4098},{"name":"SQL","experience":4,"id":4099},{"name":"PHP",
                    
21// "experience":4,"id":4100}]}
                    
                
DBManager.java https://bitbucket.org/tahaaltuntas/restfulasg.git | Java | 153 lines
                    
7
                    
8import com.google.gson.GsonBuilder;
                    
9import com.mongodb.BasicDBObject;
                    
9import com.mongodb.BasicDBObject;
                    
10import com.mongodb.DB;
                    
11import com.mongodb.DBCollection;
                    
11import com.mongodb.DBCollection;
                    
12import com.mongodb.DBCursor;
                    
13import com.mongodb.DBObject;
                    
13import com.mongodb.DBObject;
                    
14import com.mongodb.Mongo;
                    
15import com.mongodb.util.JSON;
                    
150    private User convertDBObject2User(DBObject obj) {
                    
151        return new GsonBuilder().serializeNulls().create().fromJson(JSON.serialize(obj), User.class);
                    
152    }
                    
                
UserSessionEntity.java https://gitlab.com/jlinkedit/jlinkservices | Java | 80 lines
                    
9import org.json.simple.parser.ParseException;
                    
10import org.springframework.data.mongodb.core.mapping.Document;
                    
11import org.springframework.http.converter.json.GsonBuilderUtils;
                    
12
                    
13import com.google.gson.Gson;
                    
14import com.google.gson.GsonBuilder;
                    
57		JSONObject jsonObj = (JSONObject) parser.parse(graphAsJsonStr);
                    
58		Gson gson = new GsonBuilder().create();
                    
59		GraphJsonIn graphin = null;
                    
66		if(json.containsKey("x")|| json.containsKey("y") || json.containsKey("px") || json.containsKey("py")){
                    
67			graphin = gson.fromJson(graphAsJsonStr, GraphJsonIn.class);			
                    
68			graphout = new GraphJsonOut(graphin.getNodes(),graphin.getLinks());	
                    
68			graphout = new GraphJsonOut(graphin.getNodes(),graphin.getLinks());	
                    
69			this.graphAsJsonStr = gson.toJson(graphout);
                    
70			return;
                    
                
TestDBObject.java https://github.com/bleujin/mongoNode.git | Java | 153 lines
                    
5import junit.framework.TestCase;
                    
6import net.ion.framework.parse.gson.JsonObject;
                    
7import net.ion.framework.parse.gson.JsonParser;
                    
12
                    
13import com.mongodb.BasicDBList;
                    
14import com.mongodb.BasicDBObject;
                    
14import com.mongodb.BasicDBObject;
                    
15import com.mongodb.DB;
                    
16import com.mongodb.DBCollection;
                    
16import com.mongodb.DBCollection;
                    
17import com.mongodb.DBObject;
                    
18import com.mongodb.Mongo;
                    
                
GraphEntity.java https://gitlab.com/jlinkedit/jlinkservices | Java | 95 lines
                    
10import org.bson.types.ObjectId;
                    
11import org.springframework.data.mongodb.core.mapping.DBRef;
                    
12import org.springframework.data.mongodb.core.mapping.Document;
                    
13
                    
14import com.google.gson.annotations.Expose;
                    
15
                    
                
MongoPlayerPersistor.java https://github.com/parabolika/osgi-server.git | Java | 51 lines
                    
2
                    
3import com.google.gson.Gson;
                    
4import com.mongodb.BasicDBObject;
                    
4import com.mongodb.BasicDBObject;
                    
5import com.mongodb.DBCollection;
                    
6import com.mongodb.DBObject;
                    
6import com.mongodb.DBObject;
                    
7import com.mongodb.util.JSON;
                    
8import com.parabolika.server.model.Player;
                    
14public class MongoPlayerPersistor implements IPersistor<Player, PlayerBuilder, PlayerBuilder> {
                    
15	private static final Gson GSON = new Gson();
                    
16	private final MongoContext context;
                    
28
                    
29		String json = GSON.toJson(player);
                    
30		DBObject object = (DBObject) JSON.parse(json);
                    
                
BaseIndexPojo.java https://github.com/IKANOW/Infinit.e.git | Java | 169 lines
                    
24
                    
25import com.google.gson.GsonBuilder;
                    
26import com.google.gson.JsonElement;
                    
28import com.google.gson.JsonSerializationContext;
                    
29import com.google.gson.JsonSerializer;
                    
30import com.google.gson.reflect.TypeToken;
                    
33	// Override this function to perform custom serialization (see BasePojoIndexMap)
                    
34	public GsonBuilder extendBuilder(GsonBuilder gp) {
                    
35		return extendBuilder_internal(gp);
                    
38	final public static GsonBuilder getDefaultBuilder() {
                    
39		return new GsonBuilder()
                    
40			.registerTypeAdapter(ObjectId.class, new ObjectIdSerializer())
                    
42	}
                    
43	private static GsonBuilder extendBuilder_internal(GsonBuilder gp) {
                    
44		return gp;
                    
                
IMP.java https://bitbucket.org/jyc/imp | Java | 513 lines
                    
9import com.google.gson.Gson;
                    
10import com.google.gson.GsonBuilder;
                    
11import com.mongodb.DB;
                    
41    /**
                    
42     * The Gson instance to use for all Gson operations. A class member so that
                    
43     * output can be standardized, i.e., always use setPrettyPrinting().
                    
44     */
                    
45    private Gson gson;
                    
46
                    
114        // Set pretty printing to make the outputted JSON human-readable
                    
115        this.gson = new GsonBuilder().setPrettyPrinting().create();
                    
116    }
                    
409     */
                    
410    public Gson getGson() {
                    
411        return this.gson;
                    
                
PrivacyMontiorController.java https://bitbucket.org/PranavBolar/privacymonitor_server.git | Java | 184 lines
                    
2
                    
3import com.google.gson.Gson;
                    
4import com.mongodb.MongoClient;
                    
4import com.mongodb.MongoClient;
                    
5import com.mongodb.MongoClientURI;
                    
6import com.mongodb.client.MongoCollection;
                    
6import com.mongodb.client.MongoCollection;
                    
7import com.mongodb.client.MongoDatabase;
                    
8import edu.cmu.ds.pbolar.privacymonitor.server.entity.ClientRequest;
                    
35    
                    
36    private Gson gson;
                    
37    private AzureImageFeaturizer azImageFeaturizer;
                    
42    public void init() throws ServletException {
                    
43        gson = new Gson();
                    
44        azImageFeaturizer = new AzureImageFeaturizer(gson);
                    
                
AbstractMongoDbDAO.java https://bitbucket.org/itbelts/itbelts.git | Java | 111 lines
                    
1package org.itbelts.dao.mongodb;
                    
2
                    
9
                    
10import com.google.gson.Gson;
                    
11import com.google.gson.GsonBuilder;
                    
12import com.mongodb.BasicDBObject;
                    
13import com.mongodb.DB;
                    
14import com.mongodb.DBCursor;
                    
14import com.mongodb.DBCursor;
                    
15import com.mongodb.DBObject;
                    
16import com.mongodb.Mongo;
                    
16import com.mongodb.Mongo;
                    
17import com.mongodb.util.JSON;
                    
18
                    
81            try {
                    
82                Gson g = new Gson();
                    
83                while ( cursor.hasNext() ) {
                    
                
ChannelInventoryFormulaVO.java https://bitbucket.org/piyushgd10/bhumi.git | Java | 78 lines
                    
2
                    
3import com.google.gson.Gson;
                    
4import com.unifier.core.utils.DateUtils;
                    
7import org.springframework.data.annotation.Id;
                    
8import org.springframework.data.mongodb.core.index.Indexed;
                    
9import org.springframework.data.mongodb.core.mapping.Document;
                    
75        channelInventoryFormula.setCreated(DateUtils.getCurrentTime());
                    
76        System.out.println(new Gson().toJson(channelInventoryFormula));
                    
77    }
                    
                
Application.java https://bitbucket.org/marcosflorez/mvp | Java | 2138 lines
                    
4import com.fasterxml.jackson.databind.JsonNode;
                    
5import com.google.gson.JsonArray;
                    
6import com.google.gson.JsonObject;
                    
6import com.google.gson.JsonObject;
                    
7import com.google.gson.JsonParser;
                    
8import com.google.gson.JsonPrimitive;
                    
8import com.google.gson.JsonPrimitive;
                    
9import com.mongodb.Mongo;
                    
10import com.typesafe.plugin.MailerAPI;
                    
                
MongoBase.java https://bitbucket.org/marcosflorez/mvp | Java | 2566 lines
                    
16import com.google.code.geocoder.model.LatLng;
                    
17import com.google.gson.Gson;
                    
18import com.mongodb.*;
                    
174        }
                    
175        Gson gson = new Gson();
                    
176        DBObject doc = (DBObject) JSON.parse(gson.toJson(user));
                    
200        }
                    
201        Gson gson = new Gson();
                    
202        DBObject doc = client.toDBO();
                    
229        User user = new User(obj);
                    
230        return com.mongodb.util.JSON.serialize(obj);
                    
231    }
                    
276    public static String insertFBUser(User user) {
                    
277        Gson gson = new Gson();
                    
278        DBObject doc = (DBObject) JSON.parse(gson.toJson(user));
                    
                
CRBungee.java https://gitlab.com/TheComet/CometRedis | Java | 142 lines
                    
2
                    
3import co.thecomet.db.mongodb.ResourceManager;
                    
4import co.thecomet.redis.bungee.db.ProxySettings;
                    
9import co.thecomet.redis.utils.JsonConfig;
                    
10import com.google.gson.Gson;
                    
11import com.google.gson.GsonBuilder;
                    
16import org.bson.types.ObjectId;
                    
17import org.mongodb.morphia.Datastore;
                    
18import org.mongodb.morphia.dao.BasicDAO;
                    
26public class CRBungee extends Plugin {
                    
27    private static Gson gson = new GsonBuilder().create();
                    
28    private static CRBungee instance;
                    
50
                    
51        initMongoDB();
                    
52        loadConfig();
                    
                
TwitterAuth.java https://bitbucket.org/devopstom/socallmemaybe.git | Java | 199 lines
                    
6
                    
7import com.google.gson.Gson;
                    
8import com.mongodb.*;
                    
42        try {
                    
43            //MongoURI mURI = new MongoURI("mongodb://tom@twinhelix.org:m6t6AENbKG7B@linus.mongohq.com:10081/SoCallMeMaybe");
                    
44            
                    
89      
                    
90      Gson gson = new Gson();
                    
91      String jsonString = gson.toJson(ad);
                    
162    public  AccessToken loadAccessToken(String username){
                    
163        Gson gson = new Gson();
                    
164
                    
176                cursor.close();
                    
177                TwitterAccessDetail obj = gson.fromJson((String)result.get("TwitterAccessDetail"),
                    
178                        TwitterAccessDetail.class);
                    
                
MongoDBScanner.java https://bitbucket.org/gireeshp/data-catalog-team.git | Java | 899 lines
                    
52import com.augumentiq.maxiq.configuration.dao.DataSourceInstanceDao;
                    
53import com.google.gson.Gson;
                    
54import com.mongodb.BasicDBObject;
                    
56import com.mongodb.DB;
                    
57import com.mongodb.DBCollection;
                    
58import com.mongodb.DBCursor;
                    
64import com.mongodb.client.MongoCollection;
                    
65import com.mongodb.client.MongoCursor;
                    
66import com.mongodb.client.MongoDatabase;
                    
101		DataNode node = getMongoDBCollections();
                    
102		Gson gson = new Gson();
                    
103		System.out.println(gson.toJson(node));
                    
186		int port = connectionConfig.getPort();
                    
187		String uri = "mongodb://" + userName + ":" + password + "@" + host + ":" + port;
                    
188		MongoClient mongoClient = null;
                    
                
ProfileController.java https://github.com/robhinds/SpringMongoIntegrationExample.git | Java | 101 lines
                    
1package com.tmm.nosql.mongodb.controller;
                    
2
                    
16
                    
17import com.google.gson.JsonObject;
                    
18import com.tmm.nosql.mongodb.domain.Resume;
                    
18import com.tmm.nosql.mongodb.domain.Resume;
                    
19import com.tmm.nosql.mongodb.domain.ResumePage;
                    
20import com.tmm.nosql.mongodb.helper.JsonHelper;
                    
20import com.tmm.nosql.mongodb.helper.JsonHelper;
                    
21import com.tmm.nosql.mongodb.service.ProfileService;
                    
22
                    
                
HospitalService.java https://bitbucket.org/dkhaliunaa/mal-emneleg.git | Java | 499 lines
                    
2
                    
3import com.google.gson.internal.LinkedTreeMap;
                    
4import com.model.FavoritePages;
                    
7import com.model.hos.*;
                    
8import com.mongodb.BasicDBObject;
                    
9
                    
                
MongoChannelStore.java https://github.com/atlasapi/atlas-persistence.git | Java | 457 lines
                    
28import com.google.common.collect.Sets.SetView;
                    
29import com.mongodb.BasicDBObject;
                    
30import com.mongodb.DBCollection;
                    
30import com.mongodb.DBCollection;
                    
31import com.mongodb.DBCursor;
                    
32import com.mongodb.DBObject;
                    
232
                    
233        updateNumberingsOnChannelGroups(channel, existing);
                    
234        ensureParentReference(channel);
                    
275
                    
276    private void updateNumberingsOnChannelGroups(Channel channel, Optional<Channel> existingRecord) {
                    
277        if (existingRecord.isPresent()
                    
                
BenchmarkRunner.java https://github.com/maslovalex/jvm-serializers.git | Java | 122 lines
                    
12import serializers.jackson.*;
                    
13import serializers.json.JsonGsonDatabind;
                    
14import serializers.json.JsonArgoTree;
                    
16import serializers.json.FlexjsonDatabind;
                    
17import serializers.json.JsonGsonManual;
                    
18import serializers.json.JsonGsonTree;
                    
77//        ProtobufJson.register(groups);
                    
78        JsonGsonManual.register(groups);
                    
79        JsonGsonTree.register(groups);
                    
79        JsonGsonTree.register(groups);
                    
80        JsonGsonDatabind.register(groups);
                    
81        JsonSvensonDatabind.register(groups);
                    
104        JacksonBsonDatabind.register(groups);
                    
105        MongoDB.register(groups);
                    
106
                    
                
AlchemyEntityPersonCleanser.java https://github.com/IKANOW/Infinit.e.git | Java | 878 lines
                    
27import java.util.regex.Pattern;
                    
28import com.mongodb.BasicDBObject;
                    
29import com.mongodb.DBCollection;
                    
29import com.mongodb.DBCollection;
                    
30import com.mongodb.DBCursor;
                    
31import com.mongodb.DBObject;
                    
32import com.mongodb.MongoException;
                    
33import com.google.gson.Gson;
                    
34import com.ikanow.infinit.e.data_model.store.MongoDbManager;
                    
82		
                    
83		// Launch MongoDB query
                    
84		
                    
117					BasicDBObject inner0 = new BasicDBObject(DocumentPojo.entities_, 
                    
118							(DBObject)com.mongodb.util.JSON.parse(new Gson().toJson(docu.getEntities())));
                    
119					BasicDBObject inner1 = new BasicDBObject(MongoDbManager.set_, inner0);
                    
                
AlchemyEntityGeoCleanser.java https://github.com/IKANOW/Infinit.e.git | Java | 630 lines
                    
32import com.mongodb.BasicDBObject;
                    
33import com.mongodb.DBCollection;
                    
34import com.mongodb.DBCursor;
                    
36import com.mongodb.MongoException;
                    
37import com.google.gson.Gson;
                    
38import com.google.gson.reflect.TypeToken;
                    
38import com.google.gson.reflect.TypeToken;
                    
39import com.ikanow.infinit.e.data_model.store.MongoDbManager;
                    
40import com.ikanow.infinit.e.data_model.store.document.DocumentPojo;
                    
89		
                    
90		// Launch MongoDB query
                    
91		
                    
124					BasicDBObject inner0 = new BasicDBObject(DocumentPojo.entities_, 
                    
125							(DBObject)com.mongodb.util.JSON.parse(new Gson().toJson(docu.getEntities())));
                    
126					BasicDBObject inner1 = new BasicDBObject(MongoDbManager.set_, inner0);
                    
                
StructuredAnalysisHarvester.java https://github.com/IKANOW/Infinit.e.git | Java | 3618 lines
                    
40import com.google.gson.Gson;
                    
41import com.google.gson.GsonBuilder;
                    
42import com.ikanow.infinit.e.data_model.store.DbManager;
                    
42import com.ikanow.infinit.e.data_model.store.DbManager;
                    
43import com.ikanow.infinit.e.data_model.store.MongoDbUtil;
                    
44import com.ikanow.infinit.e.data_model.store.config.source.SourcePipelinePojo.DocumentSpecPojo;
                    
61import com.ikanow.infinit.e.harvest.utils.HarvestExceptionUtils;
                    
62import com.mongodb.BasicDBList;
                    
63import com.mongodb.BasicDBObject;
                    
78		if (null == _gson) {
                    
79			GsonBuilder gb = new GsonBuilder();
                    
80			_gson = gb.create();
                    
139	public void setDocumentMetadata(DocumentPojo doc, DocumentSpecPojo docMetadataConfig) throws JSONException, ScriptException {
                    
140		Gson g = _gson;
                    
141		intializeDocIfNeeded(doc, g);
                    
                
TestCode.java https://github.com/IKANOW/Infinit.e.git | Java | 301 lines
                    
26
                    
27import com.google.gson.GsonBuilder;
                    
28import com.ikanow.infinit.e.data_model.store.DbManager;
                    
189//		feedSource.addToCommunityIds(new ObjectId(0 ,0, 1));
                    
190//		System.out.println("DUP1 feedSource=" + feedSource.getKey() + " communities=" + new com.google.gson.Gson().toJson(feedSource.getCommunityIds()));
                    
191//		harvester.harvestSource(feedSource, toAdd, toUpdate, toRemove);
                    
277//			// Check fields
                    
278//			String test1 = new com.google.gson.Gson().toJson(doc.getMetadata().get("TEST1"));
                    
279//			System.out.println("UAH TEST1: " + test1);
                    
281//			String test2 = new com.google.gson.Gson().toJson(doc.getMetadata().get("TEST2"));
                    
282//			System.out.println("UAH TEST2: " + new com.google.gson.Gson().toJson(doc.getMetadata().get("TEST2")));
                    
283//			if (!test2.equals("[{\"test\":\"alex\"}]")) System.out.println("UAH: ******** FAIL: TEST2");
                    
284//			String test3 = new com.google.gson.Gson().toJson(doc.getMetadata().get("TEST3"));
                    
285//			System.out.println("UAH TEST3: " + new com.google.gson.Gson().toJson(doc.getMetadata().get("TEST3")));
                    
286//			if (!test3.equals("[{\"test\":\"alex\"},\"chris\"]")) System.out.println("UAH: ******** FAIL: TEST3");
                    
286//			if (!test3.equals("[{\"test\":\"alex\"},\"chris\"]")) System.out.println("UAH: ******** FAIL: TEST3");
                    
287//			String test4 = new com.google.gson.Gson(
                    
                
SourceUtils.java https://github.com/IKANOW/Infinit.e.git | Java | 864 lines
                    
29
                    
30import com.google.gson.reflect.TypeToken;
                    
31import com.ikanow.infinit.e.data_model.InfiniteEnums;
                    
33import com.ikanow.infinit.e.data_model.store.DbManager;
                    
34import com.ikanow.infinit.e.data_model.store.MongoDbManager;
                    
35import com.ikanow.infinit.e.data_model.store.config.source.SourceHarvestStatusPojo;
                    
39import com.ikanow.infinit.e.processing.generic.store_and_index.StoreAndIndexManager;
                    
40import com.mongodb.BasicDBObject;
                    
41import com.mongodb.DBCursor;
                    
102		}
                    
103		BasicDBObject harvestTypes = new BasicDBObject(MongoDbManager.in_, sTypeCase);
                    
104		LinkedList<SourcePojo> sources = null;
                    
116					Date recentlySynced = new Date(now.getTime() - 1800*1000); //(ie not synced within 1/2 hour)
                    
117					query.put(SourceHarvestStatusPojo.sourceQuery_synced_, new BasicDBObject(MongoDbManager.lt_, recentlySynced));
                    
118						// (will know synced exists because we set it below - the sort doesn't work without its being set for all records)
                    
                
StoreAndIndexManager.java https://github.com/IKANOW/Infinit.e.git | Java | 1010 lines
                    
33
                    
34import com.google.gson.reflect.TypeToken;
                    
35import com.ikanow.infinit.e.data_model.index.ElasticSearchManager;
                    
38import com.ikanow.infinit.e.data_model.store.DbManager;
                    
39import com.ikanow.infinit.e.data_model.store.MongoDbManager;
                    
40import com.ikanow.infinit.e.data_model.store.config.source.SourceHarvestStatusPojo;
                    
45import com.ikanow.infinit.e.data_model.utils.PropertiesManager;
                    
46import com.mongodb.BasicDBObject;
                    
47import com.mongodb.CommandResult;
                    
47import com.mongodb.CommandResult;
                    
48import com.mongodb.DBCollection;
                    
49import com.mongodb.DBCursor;
                    
                
GenericProcessingController.java https://github.com/IKANOW/Infinit.e.git | Java | 814 lines
                    
29
                    
30import com.google.gson.Gson;
                    
31import com.ikanow.infinit.e.data_model.InfiniteEnums;
                    
37import com.ikanow.infinit.e.data_model.store.DbManager;
                    
38import com.ikanow.infinit.e.data_model.store.MongoDbManager;
                    
39import com.ikanow.infinit.e.data_model.store.config.source.SourceHarvestStatusPojo;
                    
51import com.ikanow.infinit.e.processing.generic.utils.PropertiesManager;
                    
52import com.mongodb.BasicDBObject;
                    
53import com.mongodb.DBCollection;
                    
53import com.mongodb.DBCollection;
                    
54import com.mongodb.DBCursor;
                    
55import com.mongodb.DBObject;
                    
130			// Needed to handle updates of large files containing many URLs:
                    
131			DbManager.getDocument().getMetadata().ensureIndex(new BasicDBObject(DocumentPojo.sourceUrl_, 2), new BasicDBObject(MongoDbManager.sparse_, true));
                    
132			// Needed for duplicate checking
                    
                
CommunityHandler.java https://github.com/IKANOW/Infinit.e.git | Java | 1989 lines
                    
42import com.ikanow.infinit.e.data_model.store.DbManager;
                    
43import com.ikanow.infinit.e.data_model.store.MongoDbManager;
                    
44import com.ikanow.infinit.e.data_model.store.config.source.SourcePojo;
                    
62import com.ikanow.infinit.e.processing.generic.GenericProcessingController;
                    
63import com.mongodb.BasicDBObject;
                    
64import com.mongodb.DBCursor;
                    
64import com.mongodb.DBCursor;
                    
65import com.mongodb.DBObject;
                    
66
                    
116				BasicDBObject queryTerm3 = new BasicDBObject("ownerId", new ObjectId(userIdStr));
                    
117				BasicDBObject query = new BasicDBObject(MongoDbManager.or_, Arrays.asList(queryTerm1, queryTerm2, queryTerm3));
                    
118
                    
221			
                    
222			// Get GsonBuilder object with MongoDb de/serializers registered
                    
223			BasicDBObject dbo = (BasicDBObject)DbManager.getSocial().getCommunity().findOne(query);
                    
                
QueryHandler.java https://github.com/IKANOW/Infinit.e.git | Java | 3049 lines
                    
54import com.google.common.collect.ArrayListMultimap;
                    
55import com.google.gson.Gson;
                    
56import com.google.gson.GsonBuilder;
                    
83import com.ikanow.infinit.e.data_model.utils.GeoOntologyMapping;
                    
84import com.mongodb.BasicDBObject;
                    
85import com.mongodb.DBCollection;
                    
85import com.mongodb.DBCollection;
                    
86import com.mongodb.DBCursor;
                    
87import com.mongodb.MongoException;
                    
87import com.mongodb.MongoException;
                    
88import com.mongodb.ReadPreference;
                    
89
                    
202		//DEBUG
                    
203		//querySummary.append(new Gson().toJson(query, AdvancedQueryPojo.class));
                    
204		
                    
                
InfiniteDriver.java https://github.com/IKANOW/Infinit.e.git | Java | 2004 lines
                    
46import com.google.common.collect.HashMultimap;
                    
47import com.google.gson.Gson;
                    
48import com.google.gson.JsonElement;
                    
48import com.google.gson.JsonElement;
                    
49import com.google.gson.JsonPrimitive;
                    
50import com.ikanow.infinit.e.data_model.InfiniteEnums.HarvestEnum;
                    
75import com.ikanow.infinit.e.data_model.utils.TrustManagerManipulator;
                    
76import com.mongodb.BasicDBObject;
                    
77import com.mongodb.DBObject;
                    
77import com.mongodb.DBObject;
                    
78import com.mongodb.util.JSON;
                    
79
                    
                
TestCode.java https://github.com/IKANOW/Infinit.e.git | Java | 509 lines
                    
31
                    
32import com.google.gson.Gson;
                    
33import com.google.gson.GsonBuilder;
                    
33import com.google.gson.GsonBuilder;
                    
34import com.google.gson.JsonElement;
                    
35import com.google.gson.reflect.TypeToken;
                    
59import com.ikanow.infinit.e.data_model.store.feature.entity.EntityFeaturePojo;
                    
60import com.mongodb.BasicDBList;
                    
61import com.mongodb.BasicDBObject;
                    
61import com.mongodb.BasicDBObject;
                    
62import com.mongodb.DBCollection;
                    
63import com.mongodb.MongoException;
                    
124			if (response.isSuccess()) {
                    
125				System.out.println("ALIASES: " + new com.google.gson.Gson().toJson(aliases));
                    
126				System.out.println("ALIAS MAPPINGS: " + new com.google.gson.Gson().toJson(aliasMapping));
                    
                
DocumentPojo.java https://github.com/IKANOW/Infinit.e.git | Java | 725 lines
                    
34
                    
35import com.google.gson.GsonBuilder;
                    
36import com.google.gson.JsonArray;
                    
36import com.google.gson.JsonArray;
                    
37import com.google.gson.JsonDeserializationContext;
                    
38import com.google.gson.JsonDeserializer;
                    
38import com.google.gson.JsonDeserializer;
                    
39import com.google.gson.JsonElement;
                    
40import com.google.gson.JsonObject;
                    
40import com.google.gson.JsonObject;
                    
41import com.google.gson.JsonParseException;
                    
42import com.google.gson.JsonSerializationContext;
                    
42import com.google.gson.JsonSerializationContext;
                    
43import com.google.gson.JsonSerializer;
                    
44import com.google.gson.reflect.TypeToken;
                    
                
SourcePojo.java https://github.com/IKANOW/Infinit.e.git | Java | 841 lines
                    
33
                    
34import com.google.gson.Gson;
                    
35import com.google.gson.GsonBuilder;
                    
35import com.google.gson.GsonBuilder;
                    
36import com.google.gson.JsonDeserializationContext;
                    
37import com.google.gson.JsonDeserializer;
                    
37import com.google.gson.JsonDeserializer;
                    
38import com.google.gson.JsonElement;
                    
39import com.google.gson.JsonParseException;
                    
39import com.google.gson.JsonParseException;
                    
40import com.google.gson.JsonSerializationContext;
                    
41import com.google.gson.JsonSerializer;
                    
41import com.google.gson.JsonSerializer;
                    
42import com.google.gson.reflect.TypeToken;
                    
43import com.ikanow.infinit.e.data_model.store.BaseDbPojo;
                    
                
MongoDocumentTxfer.java https://github.com/IKANOW/Infinit.e.git | Java | 663 lines
                    
35
                    
36import com.google.gson.Gson;
                    
37import com.ikanow.infinit.e.data_model.index.ElasticSearchManager;
                    
39import com.ikanow.infinit.e.data_model.store.DbManager;
                    
40import com.ikanow.infinit.e.data_model.store.MongoDbManager;
                    
41import com.ikanow.infinit.e.data_model.store.config.source.SourcePojo;
                    
49import com.ikanow.infinit.e.processing.generic.utils.PropertiesManager;
                    
50import com.mongodb.BasicDBObject;
                    
51import com.mongodb.DBCollection;
                    
51import com.mongodb.DBCollection;
                    
52import com.mongodb.DBCursor;
                    
53import com.mongodb.DBObject;
                    
53import com.mongodb.DBObject;
                    
54import com.mongodb.MongoException;
                    
55
                    
                
MongoEntityFeatureTxfer.java https://github.com/IKANOW/Infinit.e.git | Java | 435 lines
                    
29
                    
30import com.google.gson.Gson;
                    
31import com.google.gson.reflect.TypeToken;
                    
143		// Create the index if necessary
                    
144		String sMapping = new Gson().toJson(new EntityFeaturePojoIndexMap.Mapping(), EntityFeaturePojoIndexMap.Mapping.class);
                    
145		Builder localSettings = ImmutableSettings.settingsBuilder();
                    
296	@SuppressWarnings("unused")
                    
297	private void doUnitTestCode(String sMongoDbHost, String sMongoDbPort, String sElasticHost, String sElasticPort, 
                    
298			BasicDBObject query, int nLimit)
                    
299	{		
                    
300		Mongo mongoDB = null;
                    
301		ElasticSearchManager elasticManager = null;
                    
306			
                    
307			mongoDB = new Mongo(sMongoDbHost, Integer.parseInt(sMongoDbPort));
                    
308			DBCollection gazDB = mongoDB.getDB("feature").getCollection("entity");
                    
                
AbstractMongoLabDAO.java https://bitbucket.org/itbelts/itbelts.git | Java | 204 lines
                    
15
                    
16import com.google.gson.Gson;
                    
17import com.google.gson.GsonBuilder;
                    
19/**
                    
20 * Base class for anything that needs to access our MongoDB. <br>
                    
21 * <br>
                    
41    /**
                    
42     * constant that defines the MongoDB api key (for ITBelts) parameter for the rest API
                    
43     */
                    
117
                    
118            T theList = new Gson().fromJson( reader, aType );
                    
119
                    
172
                    
173            String json = new GsonBuilder().disableHtmlEscaping().create().toJson( o );
                    
174            LOGGER.info( json );
                    
                
SearchByTagsCommand.java https://bitbucket.org/abdelrahmanrustom/searchengine.git | Java | 151 lines
                    
1import com.google.gson.Gson;
                    
2import com.google.gson.JsonObject;
                    
2import com.google.gson.JsonObject;
                    
3import com.mongodb.MongoClient;
                    
4import com.mongodb.MongoClientURI;
                    
114            resJson.put("results", json_search_responses);
                    
115            Gson json = new Gson();
                    
116            res[0] = json.toJson(resJson);
                    
120            resJson.put("error", e.toString());
                    
121            Gson json = new Gson();
                    
122            res[0] = json.toJson(resJson);
                    
135//                resJson.put("results", json_search_responses);
                    
136//                Gson json = new Gson();
                    
137//                res[0] = json.toJson(resJson);
                    
142//                resJson.put("error", e.toString());
                    
143//                Gson json = new Gson();
                    
144//                res[0] = json.toJson(resJson);
                    
                
MongoDBGuild.java https://bitbucket.org/wuffy-official/bot.git | Java | 265 lines
                    
9import com.google.gson.Gson;
                    
10import com.google.gson.GsonBuilder;
                    
11import com.mongodb.client.MongoCollection;
                    
23
                    
24	private static final Gson GSON = new GsonBuilder().create();
                    
25	
                    
51
                    
52			MongoDBGuild.bulkWriteSystem.queueBulkModel(new InsertOneModel<Document>(Document.parse(MongoDBGuild.GSON.toJson(this.guildCache))));
                    
53		} else {
                    
53		} else {
                    
54			this.guildCache = MongoDBGuild.GSON.fromJson(found.toJson(), MongoGuildCache.class);
                    
55			this.filter = Filters.eq("_id", this.guildCache._id);
                    
71	public Document toDocument(Object object) {
                    
72		return Document.parse(MongoDBGuild.GSON.toJson(object));
                    
73	}
                    
                
MongoDBPersistenceTest.java https://bitbucket.org/kereena/whiteboard | Java | 200 lines
                    
1package whiteboard.persistence.mongodb;
                    
2
                    
2
                    
3import com.google.gson.Gson;
                    
4import com.google.gson.JsonElement;
                    
4import com.google.gson.JsonElement;
                    
5import com.mongodb.DB;
                    
6import com.mongodb.Mongo;
                    
21 */
                    
22public class MongoDBPersistenceTest {
                    
23
                    
25
                    
26    MongoDBPersistence testing;
                    
27
                    
36        this.database = mongo.getDB("whiteboard-testing");
                    
37        testing = new MongoDBPersistence(this.database, new CyclingHtmlColors());
                    
38    }
                    
                
BaseDbPojo.java https://github.com/IKANOW/Infinit.e.git | Java | 279 lines
                    
27
                    
28import com.google.gson.GsonBuilder;
                    
29import com.google.gson.JsonDeserializationContext;
                    
32import com.google.gson.JsonObject;
                    
33import com.google.gson.JsonParseException;
                    
34import com.google.gson.JsonSerializationContext;
                    
45	// Override this function to perform custom serialization (see BasePojoApiMap)
                    
46	public GsonBuilder extendBuilder(GsonBuilder gp) {
                    
47		return extendBuilder_internal(gp);
                    
49	// Allows API owner to enforce some custom serializations
                    
50	final public static GsonBuilder getDefaultBuilder() {
                    
51		return new GsonBuilder()
                    
58	}
                    
59	private static GsonBuilder extendBuilder_internal(GsonBuilder gp) {
                    
60		return gp;
                    
                
StandardPublisher.java https://gitlab.com/BGCX261/zonales-svn-to-git.git | Java | 73 lines
                    
6
                    
7import com.google.gson.Gson;
                    
8import com.mongodb.MongoException;
                    
32            String zMessageJson;
                    
33            Gson zMessageGson = new Gson();
                    
34            ZMessage zmessage = new ZMessage();
                    
40                Logger.getLogger(this.getClass().getName()).log(Level.INFO, "Scheduling Job - Respuesta: {0}", zMessageJson);
                    
41                zmessage = zMessageGson.fromJson(zMessageJson, ZMessage.class);
                    
42                connection.disconnect();
                    
59            Logger.getLogger(this.getClass().getName()).log(Level.INFO, "Error actualizando extracción {0}: {1}", new Object[]{zgram, ex.getMessage()});
                    
60            return ZMessages.MONGODB_ERROR.toString();
                    
61        } catch (Exception ex) {
                    
                
StandardUnpublisher.java https://gitlab.com/BGCX261/zonales-svn-to-git.git | Java | 73 lines
                    
6
                    
7import com.google.gson.Gson;
                    
8import com.mongodb.MongoException;
                    
32            String zMessageJson;
                    
33            Gson zMessageGson = new Gson();
                    
34            ZMessage zmessage = new ZMessage();
                    
40                Logger.getLogger(this.getClass().getName()).log(Level.INFO, "Unscheduling Job - Respuesta: {0}", zMessageJson);
                    
41                zmessage = zMessageGson.fromJson(zMessageJson, ZMessage.class);
                    
42                connection.disconnect();
                    
59            Logger.getLogger(this.getClass().getName()).log(Level.INFO, "Error actualizando extracción {0}: {1}", new Object[]{zgram, ex.getMessage()});
                    
60            return ZMessages.MONGODB_ERROR.toString();
                    
61        } catch (Exception ex) {
                    
                
GeoReference.java https://github.com/IKANOW/Infinit.e.git | Java | 312 lines
                    
22
                    
23import com.google.gson.reflect.TypeToken;
                    
24import com.ikanow.infinit.e.data_model.store.DbManager;
                    
25import com.ikanow.infinit.e.data_model.store.feature.geo.GeoFeaturePojo;
                    
26import com.mongodb.BasicDBObject;
                    
27import com.mongodb.DBCollection;
                    
27import com.mongodb.DBCollection;
                    
28import com.mongodb.DBCursor;
                    
29
                    
74			
                    
75			// Establish the collection manager object use to connect to MongoDB
                    
76			// The connection will persist for lifetime of import
                    
                
BenchmarkRunner.java https://github.com/eishay/jvm-serializers.git | Java | 132 lines
                    
77        ProtobufJson.register(groups);
                    
78        JsonGsonManual.register(groups);
                    
79        JsonGsonTree.register(groups);
                    
79        JsonGsonTree.register(groups);
                    
80        JsonGsonDatabind.register(groups);
                    
81        JsonSvensonDatabind.register(groups);
                    
105        // BSON is JSON-like format with extended datatypes
                    
106        MongoDB.register(groups);
                    
107
                    
                
BenchmarkRunner.java git://github.com/eishay/jvm-serializers.git | Java | 144 lines
                    
81        ProtobufJson.register(groups);
                    
82        JsonGsonManual.register(groups);
                    
83        JsonGsonTree.register(groups);
                    
83        JsonGsonTree.register(groups);
                    
84        JsonGsonDatabind.register(groups);
                    
85        JsonSvensonDatabind.register(groups);
                    
113        JacksonBsonDatabind.register(groups);
                    
114        MongoDB.register(groups);
                    
115
                    
                
DefaultTrackableUnitQueryDispatcherTests.java https://bitbucket.org/EvgenyKotkov/student-trackit-server.git | Java | 50 lines
                    
3import com.google.common.collect.ImmutableCollection;
                    
4import com.google.gson.Gson;
                    
5import org.junit.Assert;
                    
10    @Test
                    
11    @Ignore("Requires specific MongoDB setup to run.")
                    
12    public void testAddOrUpdateTrackableUnit() throws Exception {
                    
32    @Test
                    
33    @Ignore("Requires specific MongoDB setup to run.")
                    
34    public void testJsonEncodingForRetrievedTrackableUnits() throws Exception {
                    
43
                    
44        String gson = new Gson().toJson(allTrackableUnits);
                    
45        Assert.assertTrue(gson.length() > 0);
                    
45        Assert.assertTrue(gson.length() > 0);
                    
46        Assert.assertTrue(gson.contains("UNIQUE_MARKER"));
                    
47        Assert.assertTrue(gson.contains("IMAGE123"));
                    
                
SearchCommand.java https://bitbucket.org/abdelrahmanrustom/searchengine.git | Java | 175 lines
                    
1import com.google.gson.Gson;
                    
2import com.google.gson.JsonObject;
                    
124                resJson.put("error", e.toString());
                    
125                Gson json = new Gson();
                    
126                res[0] = json.toJson(resJson);
                    
138            resJson.put("results", json_search_responses);
                    
139            Gson json = new Gson();
                    
140            res[0] = json.toJson(resJson);
                    
144            resJson.put("error", e.toString());
                    
145            Gson json = new Gson();
                    
146            res[0] = json.toJson(resJson);
                    
158//                resJson.put("results", json_search_responses);
                    
159//                Gson json = new Gson();
                    
160//                res[0] = json.toJson(resJson);
                    
166//                resJson.put("error", e.toString());
                    
167//                Gson json = new Gson();
                    
168//                res[0] = json.toJson(resJson);
                    
                
Venue.java https://bitbucket.org/marcosflorez/mvp | Java | 229 lines
                    
2
                    
3import com.google.gson.Gson;
                    
4import models.Notifications.Publication;
                    
9
                    
10import com.mongodb.BasicDBObject;
                    
11import com.mongodb.DBObject;
                    
129
                    
130                this.publications.add(new Gson().fromJson(obj.toString(),Publication.class));
                    
131            }
                    
                
DataEntry.java https://github.com/greenlaw110/play-morphia.git | Java | 319 lines
                    
2
                    
3import com.google.gson.Gson;
                    
4import org.bson.types.ObjectId;
                    
5import org.joda.time.DateMidnight;
                    
6import org.mongodb.morphia.annotations.Embedded;
                    
7import org.mongodb.morphia.annotations.Entity;
                    
268    public String toJSON() {
                    
269        return new Gson().toJson(this);
                    
270    }
                    
                
CustomerE2ETest.java https://bitbucket.org/developermaster/orlando-burli-platformbuilders.git | Java | 138 lines
                    
14import org.springframework.boot.test.context.SpringBootTest;
                    
15import org.springframework.data.mongodb.core.MongoTemplate;
                    
16import org.springframework.http.ResponseEntity;
                    
21import com.github.javafaker.Faker;
                    
22import com.google.gson.Gson;
                    
23import com.mongodb.BasicDBObject;
                    
68
                    
69		final ErrorMessage errorMessage = new Gson().fromJson(response.getBody(), ErrorMessage.class);
                    
70		assertEquals("Customer name was not informed.", errorMessage.getMessage());
                    
84
                    
85		final ErrorMessage errorMessage = new Gson().fromJson(response.getBody(), ErrorMessage.class);
                    
86
                    
                
HandHistoryProviderServiceImpl.java https://bitbucket.org/biddyweb/cubeia-poker | Java | 212 lines
                    
35import com.google.code.morphia.query.Query;
                    
36import com.google.gson.*;
                    
37import com.mongodb.BasicDBObject;
                    
179    private String convertToJson(List hands) {
                    
180        Gson gson = createGson();
                    
181        return gson.toJson(hands);
                    
183
                    
184    private Gson createGson() {
                    
185        GsonBuilder b = new GsonBuilder();
                    
                
RestAPIBasedDBStorageManager.java https://bitbucket.org/talfco/clb-test.git | Java | 219 lines
                    
38import org.bson.BSONObject;
                    
39import com.mongodb.BasicDBObject;
                    
40
                    
42import com.cloudburo.test.load.CSVTestDataLoader;
                    
43import com.google.gson.JsonElement;
                    
44import com.google.gson.JsonObject;
                    
44import com.google.gson.JsonObject;
                    
45import com.google.gson.JsonParser;
                    
46
                    
                
MongoDBStorageManager.java https://bitbucket.org/e_smirnov/gp_optimizer | Java | 264 lines
                    
2
                    
3import com.google.gson.Gson;
                    
4import com.google.gson.GsonBuilder;
                    
35 */
                    
36public class MongoDBStorageManager implements IStorageManager {
                    
37
                    
102
                    
103        DBCollection collection = mongoDb.getCollection(buildCollectionName(source));
                    
104
                    
137        for (String s : mongoDb.getCollectionNames()) {
                    
138            DBCollection coll = mongoDb.getCollection(s);
                    
139            collectionSet.put(coll, (double) coll.count(query));
                    
171            mongoDb = mongo.getDB(dbName);
                    
172            GsonBuilder gsonBuilder = new GsonBuilder();
                    
173            gsonBuilder.registerTypeAdapter(JVMInstruction.class, new JVMInstructionSerializer());
                    
                
MongoDBHistoricalStorage.java git://github.com/johanlindquist/jahspotify.git | Java | 182 lines
                    
25
                    
26import com.google.gson.Gson;
                    
27import com.mongodb.*;
                    
38@Qualifier(value = "mongodb")
                    
39public class MongoDBHistoricalStorage implements HistoricalStorage
                    
40{
                    
46    private int _dbPort = 27017;
                    
47    @Value(value="${jahspotify.storage.mongodb.db-name}")
                    
48    private String _dbName = "JahSpotify";
                    
49
                    
50    private Mongo _mongoDBInstance;
                    
51    private DB _db;
                    
51    private DB _db;
                    
52    private static Gson _gson = new Gson();
                    
53
                    
                
JsonHelper.java https://github.com/robhinds/SpringMongoIntegrationExample.git | Java | 34 lines
                    
1package com.tmm.nosql.mongodb.helper;
                    
2
                    
4
                    
5import com.google.gson.JsonArray;
                    
6import com.google.gson.JsonObject;
                    
6import com.google.gson.JsonObject;
                    
7import com.tmm.nosql.mongodb.domain.Resume;
                    
8import com.tmm.nosql.mongodb.domain.ResumePage;
                    
8import com.tmm.nosql.mongodb.domain.ResumePage;
                    
9import com.tmm.nosql.mongodb.domain.Section;
                    
10
                    
                
MongoAssociationFeatureTxfer.java https://github.com/IKANOW/Infinit.e.git | Java | 263 lines
                    
29
                    
30import com.google.gson.Gson;
                    
31import com.ikanow.infinit.e.data_model.index.ElasticSearchManager;
                    
34import com.ikanow.infinit.e.data_model.store.DbManager;
                    
35import com.ikanow.infinit.e.data_model.store.MongoDbManager;
                    
36import com.ikanow.infinit.e.data_model.store.config.source.SourcePojo;
                    
40import com.ikanow.infinit.e.processing.generic.aggregation.AssociationAggregationUtils;
                    
41import com.mongodb.BasicDBObject;
                    
42import com.mongodb.DBCollection;
                    
42import com.mongodb.DBCollection;
                    
43import com.mongodb.DBCursor;
                    
44import com.mongodb.MongoException;
                    
52	/**
                    
53	 * @param args: 0,1 is the location of the MongoDB host/port, 2/3 is the location of the ES index host/port
                    
54	 * @throws MongoException 
                    
                
UserScheduleService.java https://gitlab.com/MaheshDe/VHMS | Java | 567 lines
                    
26import com.google.common.reflect.TypeToken;
                    
27import com.google.gson.Gson;
                    
28import com.mongodb.BasicDBList;
                    
28import com.mongodb.BasicDBList;
                    
29import com.mongodb.BasicDBObject;
                    
30import com.mongodb.BasicDBObjectBuilder;
                    
                
PatientRegistrationService.java https://gitlab.com/MaheshDe/VHMS | Java | 729 lines
                    
30import com.google.common.reflect.TypeToken;
                    
31import com.google.gson.Gson;
                    
32import com.google.gson.GsonBuilder;
                    
32import com.google.gson.GsonBuilder;
                    
33import com.mongodb.BasicDBList;
                    
34import com.mongodb.BasicDBObject;
                    
34import com.mongodb.BasicDBObject;
                    
35import com.mongodb.DBObject;
                    
36
                    
428						PatientRegistration.class);
                    
429				Gson gson = new GsonBuilder().setDateFormat(
                    
430						"yyyy-MM-dd HH:mm:ss").create();
                    
431				// Converting MasterEntity to a JSON string
                    
432				String master = gson.toJson(catData);
                    
433				// Converting JON string to a HashMap
                    
                
AppointmentService.java https://gitlab.com/MaheshDe/VHMS | Java | 637 lines
                    
30import com.google.common.reflect.TypeToken;
                    
31import com.google.gson.Gson;
                    
32import com.mongodb.BasicDBList;
                    
32import com.mongodb.BasicDBList;
                    
33import com.mongodb.BasicDBObject;
                    
34import com.mongodb.BasicDBObjectBuilder;
                    
259						.map(viewModel, Appointment.class);
                    
260				Gson gson = new Gson();
                    
261				// Converting MasterEntity to a JSON string
                    
261				// Converting MasterEntity to a JSON string
                    
262				String master = gson.toJson(data);
                    
263
                    
263
                    
264				Map<String, Object> map = gson.fromJson(master,
                    
265						new TypeToken<HashMap<String, Object>>() {
                    
                
LineManager.java https://bitbucket.org/Francescino/thesis.git | Java | 113 lines
                    
2
                    
3import com.mongodb.MongoClient;
                    
4import com.mongodb.client.MongoCollection;
                    
4import com.mongodb.client.MongoCollection;
                    
5import com.mongodb.client.MongoDatabase;
                    
6import it.polito.wifidata.MongoClientSingleton;
                    
11import retrofit2.Retrofit;
                    
12import retrofit2.converter.gson.GsonConverterFactory;
                    
13
                    
50                .baseUrl(BASE_URL)
                    
51                .addConverterFactory(GsonConverterFactory.create())
                    
52                .build();
                    
                
ChannelGroupIngestTask.java https://github.com/atlasapi/atlas.git | Java | 118 lines
                    
2
                    
3import static com.google.gson.FieldNamingPolicy.LOWER_CASE_WITH_UNDERSCORES;
                    
4
                    
23import com.google.common.io.Resources;
                    
24import com.google.gson.Gson;
                    
25import com.google.gson.GsonBuilder;
                    
29import com.metabroadcast.common.properties.Configurer;
                    
30import com.mongodb.Mongo;
                    
31import com.mongodb.MongoException;
                    
34    
                    
35    private final Gson gson = new GsonBuilder().setFieldNamingPolicy(LOWER_CASE_WITH_UNDERSCORES).create();
                    
36    private final ChannelGroupWriter channelGroupWriter;
                    
51            URL resource = Resources.getResource("channel-groups.json");
                    
52            IngestDocument document = gson.fromJson(Resources.toString(resource, Charsets.UTF_8), IngestDocument.class);
                    
53            
                    
                
YoutubeAnnouncement.java https://bitbucket.org/wuffy-official/bot.git | Java | 208 lines
                    
12import com.google.api.services.youtube.model.SearchResult;
                    
13import com.mongodb.client.MongoCollection;
                    
14import com.mongodb.client.model.UpdateOneModel;
                    
14import com.mongodb.client.model.UpdateOneModel;
                    
15import com.mongodb.client.model.WriteModel;
                    
16
                    
17import net.wuffy.common.logger.Logger;
                    
18import net.wuffy.common.util.GsonUtil;
                    
19import net.wuffy.core.youtube.YoutubeAPI;
                    
167		for(Document document : documents) {
                    
168			Message message = GsonUtil.GSON.fromJson(document.toJson(), Message.class);
                    
169
                    
                
PrestoController.java https://bitbucket.org/gireeshp/data-catalog-team.git | Java | 160 lines
                    
33import com.augmentiq.maxiq.services.presto.PrestoServices;
                    
34import com.google.gson.Gson;
                    
35
                    
83		// dept ON emp.dept_id = dept.dept_id INNER JOIN
                    
84		// mongodb.datacatalog.salary sal ON sal.emp_id = emp.employee_id";
                    
85		Statement statement = null;
                    
                
JsonGetVariable.java https://github.com/robhinds/SpringMongoIntegrationExample.git | Java | 63 lines
                    
3 */
                    
4package com.tmm.nosql.mongodb.taglibs;
                    
5
                    
10
                    
11import com.google.gson.JsonElement;
                    
12import com.google.gson.JsonObject;
                    
                
TestCode.java https://github.com/IKANOW/Infinit.e.git | Java | 179 lines
                    
23
                    
24import com.google.gson.GsonBuilder;
                    
25import com.ikanow.infinit.e.data_model.InfiniteEnums;
                    
35import com.ikanow.infinit.e.processing.generic.store_and_index.StoreAndIndexManager;
                    
36import com.mongodb.BasicDBObject;
                    
37
                    
119//		pxControl_feed.processDocuments(InfiniteEnums.FEEDS, toAdd_feed, toUpdate_feed, toDelete_feed); // (add, update, delete)
                    
120//		System.out.println(new GsonBuilder().setPrettyPrinting().create().toJson(toAdd_feed));
                    
121		// 2.1.2] Updating:
                    
                
InfiniteHadoopTestUtils.java https://github.com/IKANOW/Infinit.e.git | Java | 121 lines
                    
19
                    
20import com.google.gson.GsonBuilder;
                    
21import com.ikanow.infinit.e.data_model.api.BaseApiPojo;
                    
22import com.ikanow.infinit.e.data_model.api.knowledge.DocumentPojoApiMap;
                    
23import com.ikanow.infinit.e.data_model.store.MongoDbConnection;
                    
24import com.ikanow.infinit.e.data_model.store.document.DocumentPojo;
                    
24import com.ikanow.infinit.e.data_model.store.document.DocumentPojo;
                    
25import com.mongodb.MongoException;
                    
26
                    
65		String json = readFile(dataPath);
                    
66		MongoDbConnection mongoConnection = new MongoDbConnection(mongoServer, mongoPort);
                    
67		
                    
84		@Override
                    
85		public GsonBuilder extendBuilder(GsonBuilder gp) { // Extend the builder to apply standard document deserialization
                    
86			return new DocumentPojoApiMap().extendBuilder(gp);
                    
                
MongoService.java https://bitbucket.org/Lydia_Andrews/employeedetails.git | Java | 105 lines
                    
11import org.springframework.beans.factory.annotation.Autowired;
                    
12import org.springframework.data.mongodb.MongoDbFactory;
                    
13import org.springframework.data.mongodb.core.MongoOperations;
                    
13import org.springframework.data.mongodb.core.MongoOperations;
                    
14import org.springframework.data.mongodb.core.MongoTemplate;
                    
15import org.springframework.stereotype.Component;
                    
17import com.fasterxml.jackson.databind.ObjectMapper;
                    
18import com.google.gson.Gson;
                    
19import com.lydia.employeedetail.domain.EmployeeDetails;
                    
20import com.lydia.employeedetail.domain.EmployeeInfo;
                    
21import com.mongodb.BasicDBObject;
                    
22import com.mongodb.DB;
                    
22import com.mongodb.DB;
                    
23import com.mongodb.DBCollection;
                    
24import com.mongodb.DBObject;
                    
                
GridFSSerializer.java https://github.com/spinscale/play-cookbook.git | Java | 39 lines
                    
10
                    
11import com.google.gson.JsonArray;
                    
12import com.google.gson.JsonElement;
                    
12import com.google.gson.JsonElement;
                    
13import com.google.gson.JsonObject;
                    
14import com.google.gson.JsonSerializationContext;
                    
14import com.google.gson.JsonSerializationContext;
                    
15import com.google.gson.JsonSerializer;
                    
16import com.google.gson.reflect.TypeToken;
                    
16import com.google.gson.reflect.TypeToken;
                    
17import com.mongodb.gridfs.GridFSDBFile;
                    
18
                    
                
ThreadAtenderClima.java https://gitlab.com/HeanGee/SD_Socket | Java | 148 lines
                    
6import tpsocket.basededatos.ConexionBD;
                    
7import com.google.gson.Gson;
                    
8import java.io.DataInputStream;
                    
76                    /** GUARDAR EN BASE DE DATOS contentReceived_inString. */
                    
77//                    ConexionBD conec = new ConexionBD("localhost" , 27017,"test"); //Crea un Cliente del MongoDB
                    
78//                    conec.crear();  //crea la conexion a la BD
                    
88                    /** Crea un objeto JSON. */
                    
89                    Gson obJSON = new Gson();
                    
90                    /** Des-gson-nea al String, obteniendo un objeto de tipo Satelite. */
                    
                
CommunityPojo.java https://github.com/IKANOW/Infinit.e.git | Java | 589 lines
                    
28
                    
29import com.mongodb.MongoException;
                    
30import com.google.gson.reflect.TypeToken;
                    
                
Main.java https://bitbucket.org/karthik00/isslive-stream-client.git | Java | 35 lines
                    
7import com.alphadevs.isslive.LightStreamerClient;
                    
8import com.google.gson.JsonIOException;
                    
9import com.google.gson.JsonSyntaxException;
                    
13import com.lightstreamer.ls_client.SubscrException;
                    
14import com.mongodb.MongoException;
                    
15
                    
                
MongoDbUtil.java https://github.com/IKANOW/Infinit.e.git | Java | 321 lines
                    
29
                    
30import com.google.gson.JsonArray;
                    
31import com.google.gson.JsonElement;
                    
31import com.google.gson.JsonElement;
                    
32import com.google.gson.JsonObject;
                    
33import com.google.gson.JsonPrimitive;
                    
34import com.ikanow.infinit.e.data_model.utils.ThreadSafeSimpleDateFormat;
                    
35import com.mongodb.BasicDBList;
                    
36import com.mongodb.BasicDBObject;
                    
36import com.mongodb.BasicDBObject;
                    
37import com.mongodb.DBCursor;
                    
38import com.mongodb.DBObject;
                    
38import com.mongodb.DBObject;
                    
39import com.mongodb.hadoop.io.BSONWritable;
                    
40
                    
                
GetJsonArray.java https://github.com/robhinds/SpringMongoIntegrationExample.git | Java | 72 lines
                    
3 */
                    
4package com.tmm.nosql.mongodb.taglibs;
                    
5
                    
10
                    
11import com.google.gson.JsonArray;
                    
12import com.google.gson.JsonElement;
                    
12import com.google.gson.JsonElement;
                    
13import com.google.gson.JsonObject;
                    
14
                    
                
SourceSumXML.java https://github.com/IKANOW/Infinit.e.git | Java | 97 lines
                    
26import com.ikanow.infinit.e.data_model.store.document.DocumentPojo;
                    
27import com.mongodb.BasicDBObject;
                    
28import com.mongodb.hadoop.util.MongoTool;
                    
46        	//String args = context.getConfiguration().get("arguments");
                    
47        	//argumentjson aj = new Gson().fromJson(args, argumentjson.class);        	
                    
48        	//word.set(aj.word);
                    
                
DatabaseStorageService.java https://bitbucket.org/mstram/cubeia-poker | Java | 194 lines
                    
28import com.cubeia.poker.tournament.history.storage.api.TournamentHistoryPersistenceService;
                    
29import com.google.gson.Gson;
                    
30import com.google.gson.GsonBuilder;
                    
30import com.google.gson.GsonBuilder;
                    
31import com.mongodb.BasicDBObject;
                    
32import com.mongodb.DBObject;
                    
32import com.mongodb.DBObject;
                    
33import com.mongodb.util.JSON;
                    
34import org.apache.log4j.Logger;
                    
47
                    
48    private Gson gson = createGson();
                    
49
                    
157
                    
158    private Gson createGson() {
                    
159        GsonBuilder b = new GsonBuilder();
                    
                
ThreadAtenderTractor.java https://gitlab.com/HeanGee/SD_Socket | Java | 108 lines
                    
7import tpsocket.basededatos.ConexionBD;
                    
8import com.google.gson.Gson;
                    
9import java.io.DataInputStream;
                    
40            StringBuilder log = new StringBuilder();
                    
41            String mensajeGson;
                    
42            do {
                    
43                /**Lee el mensaje desde el cliente**/
                    
44                mensajeGson=this.canalEntrada.readUTF();
                    
45
                    
45
                    
46                /** GUARDAR EN BASE DE DATOS mensajeGson. */
                    
47//                ConexionBD conec = new ConexionBD("localhost" , 27017,"test"); //Crea un Cliente del MongoDB
                    
63                    /** Crea un objeto JSON. */
                    
64                    Gson obJSON = new Gson();
                    
65                    /** Des-gson-nea al String, obteniendo un objeto de tipo Satelite. */
                    
                
 

Source

Language