} catch (JClassAlreadyExistsException e) {
e.printStackTrace();
System.exit(-1);
}
final ResourceRoutesParser parser = new ResourceRoutesParser("org.graylog2.rest.resources");
final List<RouteClass> routeClassList = parser.buildClasses();
final RouteClassGenerator generator = new RouteClassGenerator(packagePrefix, codeModel);
final RouterGenerator routerGenerator = new RouterGenerator(router, generator);
routerGenerator.build(routeClassList);
// do the same for radio resources
JDefinedClass radioRouter = null;
try {
radioRouter = codeModel._class(packagePrefix + ".Radio");
} catch (JClassAlreadyExistsException e) {
e.printStackTrace();
System.exit(-1);
}
final ResourceRoutesParser radioParser = new ResourceRoutesParser("org.graylog2.radio.rest.resources");
final List<RouteClass> radioRouteClassList = radioParser.buildClasses();
final RouteClassGenerator radioGenerator = new RouteClassGenerator(packagePrefix + ".radio", codeModel);
final RouterGenerator radioRouterGenerator = new RouterGenerator(radioRouter, radioGenerator, JMod.PUBLIC);
radioRouterGenerator.build(radioRouteClassList);
JMethod radioMethod = router.method(JMod.PUBLIC | JMod.STATIC, radioRouter, "radio");