package fr.esiea.windmeal.controller.util;

import fr.esiea.windmeal.model.enumeration.Tag;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.ArrayList;
import java.util.List;

/**
 * Copyright (c) 2013 ESIEA M. Labusquiere D. Déïs
 * <p/>
 * Permission is hereby granted, free of charge, to any person obtaining
 * a copy of this software and associated documentation files (the
 * "Software"), to deal in the Software without restriction, including
 * without limitation the rights to use, copy, modify, merge, publish,
 * distribute, sublicense, and/or sell copies of the Software, and to
 * permit persons to whom the Software is furnished to do so, subject to
 * the following conditions:
 * <p/>
 * The above copyright notice and this permission notice shall be
 * included in all copies or substantial portions of the Software.
 * <p/>
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
 * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
 * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 */
@Controller
@RequestMapping("/util")
public class UtilCtrl {

    @RequestMapping(value="/tags", method = RequestMethod.GET, produces = "application/json")
    @ResponseBody
    public Iterable<Tag> getAll() {

        List<Tag> tags = new ArrayList<Tag>();
        for (Tag tag : Tag.class.getEnumConstants()) {
            tags.add(tag);
        }
        return tags;
    }
}

@@ -367,21 +367,70 @@
 va.util.
-List;
+HashMap;%0Aimport java.util.List;%0Aimport java.util.Map;%0A
 %0A%0A/**%0A *
@@ -1760,16 +1760,73 @@
  public 
+Map getAllTags() %7B%0A        Map map = new HashMap%3C String,
 Iterable
@@ -1834,20 +1834,12 @@
 Tag%3E
- getAll() %7B%0A
+%3E();
 %0A   
@@ -1974,16 +1974,47 @@
       %7D%0A
+        map.put(%22tags%22, tags);%0A
         
@@ -2020,20 +2020,19 @@
  return 
-tags
+map
 ;%0A    %7D%0A

Make json format the getAllTag ctrl