Abstract Doc class and toJson method