/** * Attaches a Restlet to this router as the default target to invoke when no * route matches. It actually sets a default route that scores all calls to * 1.0. * * @param defaultTarget * The Restlet to use as the default target. * @return The created route. */ public Route attachDefault(Restlet defaultTarget) { final Route result = createRoute("", defaultTarget); setDefaultRoute(result); return result; }
/** * Attaches a target Restlet to this router based on a given URI pattern. A * new route will be added routing to the target when calls with a URI * matching the pattern will be received. * * @param uriPattern * The URI pattern that must match the relative part of the * resource URI. * @param target * The target Restlet to attach. * @return The created route. */ public Route attach(String uriPattern, Restlet target) { final Route result = createRoute(uriPattern, target); getRoutes().add(result); return result; }