private void collectBindings ( List < SitebricksModule . LinkingBinder > bindings , Set < PageBook . Page > pagesToCompile ) { // Reverse the method map for easy lookup of HTTP method annotations. Map < Class < ? extends Annotation > , String > methodSet = null ; //go thru bindings and obtain pages from them. for ( SitebricksModule . LinkingBinder binding : bindings ) { if ( EMBEDDED == binding . bindingKind ) { if ( null == binding . embedAs ) { // This can happen if embed() is not followed by an .as(..) throw new IllegalStateException ( "embed() missing .as() clause: " + binding . pageClass ) ; } registry . addEmbed ( binding . embedAs ) ; pagesToCompile . add ( pageBook . embedAs ( binding . pageClass , binding . embedAs ) ) ; } else if ( PAGE == binding . bindingKind ) { pagesToCompile . add ( pageBook . at ( binding . uri , binding . pageClass ) ) ; } else if ( STATIC_RESOURCE == binding . bindingKind ) { //localize the resource to the SitebricksModule's package. resourcesService . add ( SitebricksModule . class , binding . getResource ( ) ) ; } else if ( SERVICE == binding . bindingKind ) { pagesToCompile . add ( pageBook . serviceAt ( binding . uri , binding . pageClass ) ) ; } else if ( ACTION == binding . bindingKind ) { // Lazy create this inverse lookup map, once. if ( null == methodSet ) { methodSet = HashBiMap . create ( methodMap ) . inverse ( ) ; } pageBook . at ( binding . uri , binding . actionDescriptors , methodSet ) ; } } }
processes all explicit bindings including static resources .