Code example for GsonBuilder

Methods: registerTypeAdapter

0
{ 
	private static GsonBuilder _gsonBuilder;
	 
	static 
	{ 
		JSONHelper._gsonBuilder = new GsonBuilder();
		JSONHelper._gsonBuilder .registerTypeAdapter(TrainingExercise.class  ,new TrainingExerciseJsonAdapter<TrainingExercise>());
		JSONHelper._gsonBuilder .registerTypeAdapter(TrainingPlan.class  ,new TrainingExerciseJsonAdapter<TrainingPlan>());
		JSONHelper._gsonBuilder .registerTypeAdapter(TrainingSeries.class  ,new TrainingExerciseJsonAdapter<TrainingSeries>());
		JSONHelper._gsonBuilder .registerTypeAdapter(TrainingSeriesData.class  ,new TrainingExerciseJsonAdapter<TrainingSeriesData>());
	} 
	 
	public static String LoadFromAsset(HeraclesActivity activity,
			String fileName, String extension)
	{ 
		String fileContent = null;
		try 
		{ 
			String file = fileName + "." + extension;
			InputStream is = activity.getAssets().open(file);
Experience pair programming with AI  Get Codota for Java