package com.decker.Essentials.Category;

import java.awt.List;
import java.util.LinkedList;

import com.decker.Essentials.User.UserType;

public class Category
{
    public LinkedList<CategoryChild> AnonymousCategory;
    public LinkedList<CategoryChild> StudentCategory;
    public LinkedList<CategoryChild> TeacherCategory;
    public LinkedList<CategoryChild> AdministrarorCategory;

    public Category()
    {
	this.AnonymousCategory = new LinkedList<CategoryChild>();
	this.StudentCategory = new LinkedList<CategoryChild>();
	this.TeacherCategory = new LinkedList<CategoryChild>();
	this.AdministrarorCategory = new LinkedList<CategoryChild>();
    }

    public void addFunctionToCategory(UserType category, String iconName, String title, String url)
    {
	CategoryChild child = new CategoryChild(iconName, title, url);
	switch (category)
	{
	case Anonymous:
	    this.AnonymousCategory.add(child);
	    break;
	case Student:
	    this.AnonymousCategory.add(child);
	    break;
	case Teacher:
	    this.AnonymousCategory.add(child);
	    break;
	case SystemAdmin:
	    this.AnonymousCategory.add(child);
	    break;

	default:
	    break;
	}
    }
}

@@ -140,34 +140,250 @@
 e;%0D%0A
-%0D%0Apublic class Category%0D%0A%7B
+import com.google.gson.Gson;%0D%0A%0D%0Apublic class Category%0D%0A%7B%0D%0A    public static Category _Instance;%0D%0A%0D%0A    public static Category getInstance()%0D%0A    %7B%0D%0A%09if (_Instance == null)%0D%0A%09%7B%0D%0A%09    _Instance = new Category();%0D%0A%09%7D%0D%0A%09return _Instance;%0D%0A    %7D%0D%0A
 %0D%0A  
@@ -615,21 +615,22 @@
 %0A%0D%0A    p
-ublic
+rivate
  Categor
@@ -1409,12 +1409,499 @@
 %0D%0A    %7D%0D
+%0A%0D%0A    public  String getJsonCategory(UserType type)%0D%0A    %7B%0D%0A%09Gson serializator = new Gson();%0D%0A%09switch (type)%0D%0A%09%7B%0D%0A%09case Anonymous:%0D%0A%09    return serializator.toJson(_Instance.AnonymousCategory);%0D%0A%0D%0A%09case Student:%0D%0A%09    return serializator.toJson(_Instance.StudentCategory);%0D%0A%0D%0A%09case Teacher:%0D%0A%09    return serializator.toJson(_Instance.TeacherCategory);%0D%0A%0D%0A%09case SystemAdmin:%0D%0A%09    return serializator.toJson(_Instance.AdministrarorCategory);%0D%0A%0D%0A%09default:%0D%0A%09    return null;%0D%0A%09%7D%0D%0A%0D%0A    %7D%0D
 %0A%7D%0D%0A

Add catch json method to Category.java