private <T> Class<? extends T> find(Class<T> cls, String cname) { String pkg = hostClass.getPackage().getName(); return find(cls, pkg, cname); }
private <T> Class<? extends T> find(Class<T> cls, String cname) { String pkg = hostClass.getPackage().getName(); return find(cls, pkg, cname); }
private <T> Class<? extends T> find(Class<T> cls, String cname) { String pkg = hostClass.getPackage().getName(); return find(cls, pkg, cname); }
private void addDefaultView(Dest dest) { String controllerName = dest.controllerClass.getSimpleName(); if (controllerName.endsWith("Controller")) { controllerName = controllerName.substring(0, controllerName.length() - 10); } dest.defaultViewClass = find(View.class, dest.controllerClass.getPackage().getName(), join(controllerName + "View")); }
private void addDefaultView(Dest dest) { String controllerName = dest.controllerClass.getSimpleName(); if (controllerName.endsWith("Controller")) { controllerName = controllerName.substring(0, controllerName.length() - 10); } dest.defaultViewClass = find(View.class, dest.controllerClass.getPackage().getName(), join(controllerName + "View")); }
private void addDefaultView(Dest dest) { String controllerName = dest.controllerClass.getSimpleName(); if (controllerName.endsWith("Controller")) { controllerName = controllerName.substring(0, controllerName.length() - 10); } dest.defaultViewClass = find(View.class, dest.controllerClass.getPackage().getName(), join(controllerName + "View")); }
private Dest resolveDefault(WebApp.HTTP method, String path) { List<String> parts = WebApp.parseRoute(path); String controller = parts.get(WebApp.R_CONTROLLER); String action = parts.get(WebApp.R_ACTION); // NameController is encouraged default Class<? extends Controller> cls = find(Controller.class, join(controller, "Controller")); if (cls == null) { cls = find(Controller.class, controller); } if (cls == null) { throw new WebAppException(join(path, ": controller for ", controller, " not found")); } return add(method, defaultPrefix(controller, action), cls, action, null); }
private Dest resolveDefault(WebApp.HTTP method, String path) { List<String> parts = WebApp.parseRoute(path); String controller = parts.get(WebApp.R_CONTROLLER); String action = parts.get(WebApp.R_ACTION); // NameController is encouraged default Class<? extends Controller> cls = find(Controller.class, join(controller, "Controller")); if (cls == null) { cls = find(Controller.class, controller); } if (cls == null) { throw new WebAppException(join(path, ": controller for ", controller, " not found")); } return add(method, defaultPrefix(controller, action), cls, action, null); }
private Dest resolveDefault(WebApp.HTTP method, String path) { List<String> parts = WebApp.parseRoute(path); String controller = parts.get(WebApp.R_CONTROLLER); String action = parts.get(WebApp.R_ACTION); // NameController is encouraged default Class<? extends Controller> cls = find(Controller.class, join(controller, "Controller")); if (cls == null) { cls = find(Controller.class, controller); } if (cls == null) { throw new WebAppException(join(path, ": controller for ", controller, " not found")); } return add(method, defaultPrefix(controller, action), cls, action, null); }