private Set<Class<?>> collectModules(SpecInfo spec) { Set<Class<?>> modules = null; for (SpecInfo curr : spec.getSpecsTopToBottom()) { if (importModuleAnnotation != null && spec.isAnnotationPresent(importModuleAnnotation)){ org.apache.tapestry5.ioc.annotations.ImportModule importModule = curr .getAnnotation(org.apache.tapestry5.ioc.annotations.ImportModule.class); if (importModule != null) { if (modules == null) { modules = new HashSet<>(); } modules.addAll(Arrays.<Class<?>> asList(importModule.value())); } } if (submoduleAnnotation != null && spec.isAnnotationPresent(submoduleAnnotation)){ @SuppressWarnings("deprecation") SubModule subModule = curr.getAnnotation(SubModule.class); if (subModule != null) { if (modules == null) { modules = new HashSet<>(); } modules.addAll(Arrays.<Class<?>> asList(subModule.value())); } } } return modules; } }
@SubModule(Module2.class) public class Module1 { public static void bind(ServiceBinder binder) { binder.bind(IService1.class, Service1.class); binder.bind(IService3.class, Service3.class); } public void contributeApplicationDefaults(MappedConfiguration<String, String> configuration) { configuration.add("configKey", "configValue"); } }
queue.addAll(Arrays.asList(subModule.value()));
/** * Used by {@link ioc.specs.RegistryBuilderSpec}. */ // Leaving this one here as a compatibility test; other SubModules have been converted to ImportModule. @SubModule( {FredModule.class, BarneyModule.class}) public final class MasterModule { }
queue.addAll(Arrays.asList(subModule.value()));
@SubModule(JSModule.class) public class JQueryModule {
private Set<Class<?>> collectModules(SpecInfo spec) { Set<Class<?>> modules = null; for (SpecInfo curr : spec.getSpecsTopToBottom()) { if (importModuleAnnotation != null && spec.isAnnotationPresent(importModuleAnnotation)){ org.apache.tapestry5.ioc.annotations.ImportModule importModule = curr .getAnnotation(org.apache.tapestry5.ioc.annotations.ImportModule.class); if (importModule != null) { if (modules == null) { modules = new HashSet<>(); } modules.addAll(Arrays.<Class<?>> asList(importModule.value())); } } if (submoduleAnnotation != null && spec.isAnnotationPresent(submoduleAnnotation)){ @SuppressWarnings("deprecation") SubModule subModule = curr.getAnnotation(SubModule.class); if (subModule != null) { if (modules == null) { modules = new HashSet<>(); } modules.addAll(Arrays.<Class<?>> asList(subModule.value())); } } } return modules; } }