public InvocationRouter < InvocationBaratine > buildRouter ( WebApp webApp ) { // find views InjectorAmp inject = webApp . inject ( ) ; buildViews ( inject ) ; ArrayList < RouteMap > mapList = new ArrayList <> ( ) ; ServicesAmp manager = webApp . services ( ) ; ServiceRefAmp serviceRef = manager . newService ( new RouteService ( ) ) . ref ( ) ; while ( _routes . size ( ) > 0 ) { ArrayList < RouteWebApp > routes = new ArrayList <> ( _routes ) ; _routes . clear ( ) ; for ( RouteWebApp route : routes ) { mapList . addAll ( route . toMap ( inject , serviceRef ) ) ; } } /* for (RouteConfig config : _routeList) { RouteBaratine route = config.buildRoute(); mapList.add(new RouteMap("", route)); } */ RouteMap [ ] routeArray = new RouteMap [ mapList . size ( ) ] ; mapList . toArray ( routeArray ) ; return new InvocationRouterWebApp ( webApp , routeArray ) ; }
Builds the web - app s router