/** * Parse application bytecode, build route methods from it and merge output with the given routes. * * @param application Application to parse. * @return List of route methods. * @throws Exception If something goes wrong. */ public List<RouteMethod> parseFully(Jooby application) throws Exception { List<RouteMethod> methods = parseFully(application.getClass().getName(), Jooby.exportRoutes(application)); return methods; }
public MockRouter(final Jooby app, final Request req, final Response rsp) { this.routes = Jooby.exportRoutes(hackInjector(app)); this.req = req; this.rsp = rsp; }
/** * Export configuration from an application. Useful for tooling, testing, debugging, etc... * * @param app Application to extract/collect configuration. * @return Application conf or <code>empty</code> conf on error. */ public static Config exportConf(final Jooby app) { AtomicReference<Config> conf = new AtomicReference<>(ConfigFactory.empty()); app.on("*", c -> { conf.set(c); }); exportRoutes(app); return conf.get(); }
public MockRouter(final Jooby app, final Request req, final Response rsp) { this.routes = Jooby.exportRoutes(hackInjector(app)); this.req = req; this.rsp = rsp; }
/** * Process a {@link Jooby} application and collect {@link RouteSpec}. * * @param app A jooby app to process. * @param srcdir Basedir where source code is located. Useful for extracting doc. * @param outdir Where to save the compiled route specs. * @return List of route specs. */ private List<RouteSpec> processInternal(final Jooby app, final Path srcdir, final Path outdir) { List<Route.Definition> routes = Jooby.exportRoutes(app); return processInternal(app.getClass(), routes, srcdir, outdir); }
/** * Parse application bytecode, build route methods from it and merge output with the given routes. * * @param application Application to parse. * @return List of route methods. * @throws Exception If something goes wrong. */ public List<RouteMethod> parseFully(Jooby application) throws Exception { List<RouteMethod> methods = parseFully(application.getClass().getName(), Jooby.exportRoutes(application)); return methods; }
/** * Export configuration from an application. Useful for tooling, testing, debugging, etc... * * @param app Application to extract/collect configuration. * @return Application conf or <code>empty</code> conf on error. */ public static Config exportConf(final Jooby app) { AtomicReference<Config> conf = new AtomicReference<>(ConfigFactory.empty()); app.on("*", c -> { conf.set(c); }); exportRoutes(app); return conf.get(); }