001 package com.khubla.pragmatach.plugin.adminapp; 002 003 import java.util.Set; 004 005 import com.khubla.pragmatach.framework.annotation.Controller; 006 import com.khubla.pragmatach.framework.annotation.Route; 007 import com.khubla.pragmatach.framework.annotation.View; 008 import com.khubla.pragmatach.framework.api.PragmatachException; 009 import com.khubla.pragmatach.framework.api.Response; 010 import com.khubla.pragmatach.framework.controller.Controllers; 011 012 /** 013 * @author tome 014 */ 015 @Controller(name = "pragmatachShowControllersController") 016 @View(view = "pragmatach/admin/controllers.html") 017 public class ShowControllersController extends SecuredAdminController { 018 private Set<Class<?>> controllers; 019 020 public Controller getControllerAnnotation(Class<?> clazz) { 021 return clazz.getAnnotation(Controller.class); 022 } 023 024 public Set<Class<?>> getControllers() { 025 return controllers; 026 } 027 028 @Route(uri = "/pragmatach/admin/controllers") 029 public Response render() throws PragmatachException { 030 controllers = Controllers.getInstance().getControllers(); 031 return super.render(); 032 } 033 034 public void setControllers(Set<Class<?>> controllers) { 035 this.controllers = controllers; 036 } 037 }