@SuppressWarnings("unchecked") private <T> T provideNewInstanceOf(Class<T> type, Map<String, Object> properties) { // instantiation if it's real class if (!type.isInterface() && !type.isEnum() && !type.isAnnotation()) { if (Msc.matchingProfile(type)) { T instance = instantiate(type, properties); return register(instance, properties); } } return null; }
Class<?> clazz = Cls.toClass(classOrInstance); if (Msc.matchingProfile(clazz)) {
private void processBean(boolean register, Object bean) { Class<?> clazz; U.notNull(bean, "bean"); IoCContext context = setup.context(); if (bean instanceof Class<?>) { clazz = (Class<?>) bean; bean = null; } else { clazz = bean.getClass(); } if (!Cls.isAppBeanType(clazz)) { throw new RuntimeException("Expected a bean, but found value of type: " + clazz.getName()); } if (!Msc.matchingProfile(clazz)) { return; } Log.debug("Processing bean", "class", clazz, "instance", bean); List<String> componentPaths = getControllerUris(clazz); for (String ctxPath : componentPaths) { for (Method method : Cls.getMethods(clazz)) { if (shouldExpose(method)) { if (bean == null) { bean = register ? context.singleton(clazz) : null; } registerOrDeregister(register, bean, ctxPath, method); } } } }
@SuppressWarnings("unchecked") private <T> T provideNewInstanceOf(Class<T> type, Map<String, Object> properties) { // instantiation if it's real class if (!type.isInterface() && !type.isEnum() && !type.isAnnotation()) { if (Msc.matchingProfile(type)) { T instance = instantiate(type, properties); return register(instance, properties); } } return null; }
Class<?> clazz = Cls.toClass(classOrInstance); if (Msc.matchingProfile(clazz)) {
private void processBean(boolean register, Object bean) { Class<?> clazz; U.notNull(bean, "bean"); IoCContext context = setup.context(); if (bean instanceof Class<?>) { clazz = (Class<?>) bean; bean = null; } else { clazz = bean.getClass(); } if (!Cls.isAppBeanType(clazz)) { throw new RuntimeException("Expected a bean, but found value of type: " + clazz.getName()); } if (!Msc.matchingProfile(clazz)) { return; } Log.debug("Processing bean", "class", clazz, "instance", bean); List<String> componentPaths = getControllerUris(clazz); for (String ctxPath : componentPaths) { for (Method method : Cls.getMethods(clazz)) { if (shouldExpose(method)) { if (bean == null) { bean = register ? context.singleton(clazz) : null; } registerOrDeregister(register, bean, ctxPath, method); } } } }