Java Code Examples for org.springframework.context.annotation.ClassPathScanningCandidateComponentProvider#findCandidateComponents()

The following examples show how to use org.springframework.context.annotation.ClassPathScanningCandidateComponentProvider#findCandidateComponents() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: Neo4jConfigurationSupport.java    From sdn-rx with Apache License 2.0 7 votes vote down vote up
/**
 * Scans the given base package for entities, i.e. Neo4j specific types annotated with {@link Node}.
 *
 * @param basePackage must not be {@literal null}.
 * @return found entities in the package to scan.
 * @throws ClassNotFoundException if the given class cannot be loaded by the class loader.
 */
protected final Set<Class<?>> scanForEntities(String basePackage) throws ClassNotFoundException {

	if (!StringUtils.hasText(basePackage)) {
		return Collections.emptySet();
	}

	Set<Class<?>> initialEntitySet = new HashSet<Class<?>>();

	ClassPathScanningCandidateComponentProvider componentProvider =
		new ClassPathScanningCandidateComponentProvider(false);
	componentProvider.addIncludeFilter(new AnnotationTypeFilter(Node.class));

	ClassLoader classLoader = Neo4jConfigurationSupport.class.getClassLoader();
	for (BeanDefinition candidate : componentProvider.findCandidateComponents(basePackage)) {
		initialEntitySet.add(ClassUtils.forName(candidate.getBeanClassName(), classLoader));
	}

	return initialEntitySet;
}
 
Example 2
Source File: ErrorService.java    From gemini with Apache License 2.0 6 votes vote down vote up
@Override
public void afterPropertiesSet() throws Exception {
    ClassPathScanningCandidateComponentProvider provider = new ClassPathScanningCandidateComponentProvider(false);
    provider.addIncludeFilter(new AssignableTypeFilter(GeminiException.class));
    Set<BeanDefinition> components = provider.findCandidateComponents("it.at7.gemini");
    for (BeanDefinition component : components) {
        Class<?> gemException = Class.forName(component.getBeanClassName());
        Class<?>[] innerClasses = gemException.getDeclaredClasses();
        for (Class<?> innerClass : innerClasses) {
            String simpleName = innerClass.getSimpleName();
            if (simpleName.equals("Code")) {
                Enum[] enumConstants = (Enum[]) innerClass.getEnumConstants();
                register(enumConstants);
            }
        }
    }
}
 
Example 3
Source File: QueryByCriteriaJaxbTest.java    From rice with Educational Community License v2.0 6 votes vote down vote up
/**
 * Search the classes in the PREDICATE_BASE_PACKAGE and build a list of all simple (non-composite) Predicate classes
 * @return a list of simple Predicate classes
 * @throws ClassNotFoundException
 */
private ArrayList<Class<?>> discoverSimplePredicateClasses() throws ClassNotFoundException {
    ArrayList<Class<?>> discoveredPredicateClasses = new ArrayList<Class<?>>();

    // This technique was copped from:
    // http://stackoverflow.com/questions/520328/can-you-find-all-classes-in-a-package-using-reflection

    ClassPathScanningCandidateComponentProvider provider = new ClassPathScanningCandidateComponentProvider(true);
    provider.addIncludeFilter(new AssignableTypeFilter(Predicate.class));

    // scan in org.example.package
    Set<BeanDefinition> components = provider.findCandidateComponents(PREDICATE_BASE_PACKAGE);
    for (BeanDefinition component : components)
    {
        Class cls = Class.forName(component.getBeanClassName());
        if (!cls.isMemberClass()                             // filter out inner class predicates from test packages
            && Predicate.class.isAssignableFrom(cls)         // filter out any non-predicate classes
            && !CompositePredicate.class.isAssignableFrom(cls)) // filter out 'and' and 'or' predicates
        {
            discoveredPredicateClasses.add(cls);
            // use class cls found
            LOG.debug("discovered " + cls.toString());
        }
    }
    return discoveredPredicateClasses;
}
 
Example 4
Source File: EventHandlerUtils.java    From cqrs-es-kafka with MIT License 6 votes vote down vote up
public static Map<String, EventHandler> buildEventHandlersRegistry(final String basePackage,
                                                                   final ApplicationContext context) {

    final Map<String, EventHandler> registry = new HashMap<>();
    final ClassPathScanningCandidateComponentProvider scanner = new ClassPathScanningCandidateComponentProvider(false);
    final AutowireCapableBeanFactory beanFactory = context.getAutowireCapableBeanFactory();
    scanner.addIncludeFilter(new AssignableTypeFilter(EventHandler.class));

    EventHandler currentHandler = null;

    for (BeanDefinition bean : scanner.findCandidateComponents(basePackage)) {
        currentHandler = (EventHandler) beanFactory.createBean(ClassUtils.resolveClassName(bean.getBeanClassName(), context.getClassLoader()),
                AutowireCapableBeanFactory.AUTOWIRE_BY_TYPE, true);
        registry.put(currentHandler.getInterest(), currentHandler);
    }

    return registry;
}
 
Example 5
Source File: NetworkAssemble.java    From network-spring-boot-starter with Apache License 2.0 6 votes vote down vote up
@Override
public void registerBeanDefinitions(AnnotationMetadata importingClassMetadata, BeanDefinitionRegistry registry) {
	ClassPathScanningCandidateComponentProvider scanner = new ScanningComponent(Boolean.FALSE, this.environment);
	scanner.setResourceLoader(this.resourceLoader);

	AnnotationTypeFilter annotationTypeFilter = new AnnotationTypeFilter(Network.class);
	scanner.addIncludeFilter(annotationTypeFilter);

	String packageName = ClassUtils.getPackageName(importingClassMetadata.getClassName());
	Set<BeanDefinition> candidateComponents = scanner.findCandidateComponents(packageName);
	candidateComponents.forEach(beanDefinition -> {
		AnnotatedBeanDefinition annotatedBeanDefinition = (AnnotatedBeanDefinition) beanDefinition;
		AnnotationMetadata annotationMetadata = annotatedBeanDefinition.getMetadata();
		BeanDefinitionBuilder definition = BeanDefinitionBuilder.genericBeanDefinition(NetworkFactory.class);
		String className = annotationMetadata.getClassName();
		definition.addPropertyValue(NetworkFactoryConstants.PROPERTY_VALUE.getValue(), className);
		definition.setAutowireMode(AbstractBeanDefinition.AUTOWIRE_BY_TYPE);

		AbstractBeanDefinition abstractBeanDefinition = definition.getBeanDefinition();
		BeanDefinitionHolder holder = new BeanDefinitionHolder(abstractBeanDefinition, className);
		BeanDefinitionReaderUtils.registerBeanDefinition(holder, registry);

	});

}
 
Example 6
Source File: NettyRpcClientBeanDefinitionRegistrar.java    From spring-boot-protocol with Apache License 2.0 6 votes vote down vote up
@Override
public void registerBeanDefinitions(AnnotationMetadata metadata, BeanDefinitionRegistry registry) {
    GenericBeanDefinition beanPostProcessorDefinition = new GenericBeanDefinition();
    beanPostProcessorDefinition.setInstanceSupplier(()->this);
    beanPostProcessorDefinition.setBeanClass(BeanPostProcessor.class);
    registry.registerBeanDefinition("NettyRpcClientBeanPostProcessor",beanPostProcessorDefinition);

    ClassPathScanningCandidateComponentProvider scanner = getScanner();
    scanner.setResourceLoader(resourceLoader);
    scanner.addIncludeFilter(new AnnotationTypeFilter(NettyRpcClient.class));
    Map<String, Object> enableNettyRpcClientsAttributes = metadata.getAnnotationAttributes(enableNettyRpcClientsCanonicalName);

    for (String basePackage : getBasePackages(metadata,enableNettyRpcClientsAttributes)) {
        for (BeanDefinition candidateComponent : scanner.findCandidateComponents(basePackage)) {
            if (!(candidateComponent instanceof AnnotatedBeanDefinition)) {
                continue;
            }

            AnnotatedBeanDefinition beanDefinition = (AnnotatedBeanDefinition) candidateComponent;
            if(!beanDefinition.getMetadata().isInterface()) {
                throw new IllegalArgumentException("@NettyRpcClient can only be specified on an interface");
            }
            registerNettyRpcClient(beanDefinition,registry);
        }
    }
}
 
Example 7
Source File: RestConfiguration.java    From moserp with Apache License 2.0 6 votes vote down vote up
@Override
public void configureRepositoryRestConfiguration(RepositoryRestConfiguration config) {
    ClassPathScanningCandidateComponentProvider provider = new ClassPathScanningCandidateComponentProvider(true);
    provider.addIncludeFilter(new AssignableTypeFilter(IdentifiableEntity.class));
    Set<BeanDefinition> components = provider.findCandidateComponents(this.getClass().getPackage().getName());
    List<Class<?>> classes = new ArrayList<>();

    components.forEach(component -> {
        try {
            classes.add(Class.forName(component.getBeanClassName()));
        } catch (Exception e) {
            e.printStackTrace();
        }
    });

    config.exposeIdsFor(classes.toArray(new Class[classes.size()]));
}
 
Example 8
Source File: SpringClassHierarchySupplier.java    From feign-error-decoder with MIT License 6 votes vote down vote up
@Override
public Set<Class<?>> getSubClasses(Class<?> clazz, String basePackage) {
  ClassPathScanningCandidateComponentProvider provider =
      new ClassPathScanningCandidateComponentProvider(false);
  provider.addIncludeFilter(new AssignableTypeFilter(clazz));

  Set<BeanDefinition> components = provider.findCandidateComponents(basePackage);

  return components
      .stream()
      .map(
          component -> {
            try {
              return Class.forName(component.getBeanClassName());
            } catch (ClassNotFoundException e) {
              throw new IllegalStateException(
                  String.format("Could not load child class '%s'.", component.getBeanClassName()),
                  e);
            }
          })
      .collect(Collectors.toSet());
}
 
Example 9
Source File: Schema.java    From usergrid with Apache License 2.0 6 votes vote down vote up
@SuppressWarnings("unchecked")
public void scanEntities() {
    synchronized ( entitiesScanPath ) {
        for ( String path : entitiesScanPath ) {
            ClassPathScanningCandidateComponentProvider provider =
                    new ClassPathScanningCandidateComponentProvider( true );
            provider.addIncludeFilter( new AssignableTypeFilter( TypedEntity.class ) );

            Set<BeanDefinition> components = provider.findCandidateComponents( path );
            for ( BeanDefinition component : components ) {
                try {
                    Class<?> cls = Class.forName( component.getBeanClassName() );
                    if ( Entity.class.isAssignableFrom( cls ) ) {
                        registerEntity( ( Class<? extends Entity> ) cls );
                    }
                }
                catch ( ClassNotFoundException e ) {
                    logger.error( "Unable to get entity class ", e );
                }
            }
            registerEntity( DynamicEntity.class );
        }
    }
}
 
Example 10
Source File: ExternalSource.java    From syndesis with Apache License 2.0 6 votes vote down vote up
static Class<? extends ExecutionFactory<?, ?>> findTranslatorInPackage(String translatorName,
        ClassPathScanningCandidateComponentProvider provider, String packageName) {
    Set<BeanDefinition> components = provider.findCandidateComponents(packageName);
    for (BeanDefinition c : components) {
        try {
            @SuppressWarnings("unchecked")
            Class<? extends ExecutionFactory<?, ?>> clazz = (Class<? extends ExecutionFactory<?, ?>>) Class
            .forName(c.getBeanClassName());
            String name = clazz.getAnnotation(Translator.class).name();
            if (name.equals(translatorName)) {
                return clazz;
            }
        } catch (ClassNotFoundException | SecurityException | IllegalArgumentException e) {
            throw new IllegalStateException("Error loading translators", e);
        }
    }
    return null;
}
 
Example 11
Source File: ExternalSource.java    From teiid-spring-boot with Apache License 2.0 6 votes vote down vote up
static Class<? extends ExecutionFactory<?, ?>> findTranslatorInPackage(String translatorName,
        ClassPathScanningCandidateComponentProvider provider, String packageName) {
    Set<BeanDefinition> components = provider.findCandidateComponents(packageName);
    for (BeanDefinition c : components) {
        try {
            @SuppressWarnings("unchecked")
            Class<? extends ExecutionFactory<?, ?>> clazz = (Class<? extends ExecutionFactory<?, ?>>) Class
            .forName(c.getBeanClassName());
            String name = clazz.getAnnotation(Translator.class).name();
            if (name.equals(translatorName)) {
                return clazz;
            }
        } catch (ClassNotFoundException | SecurityException | IllegalArgumentException e) {
            throw new IllegalStateException("Error loading translators", e);
        }
    }
    return null;
}
 
Example 12
Source File: InventoryQueryDetailsGenerator.java    From zstack with Apache License 2.0 5 votes vote down vote up
public static void generate(String exportPath, List<String> basePkgs) {
    try {
        if (exportPath == null) {
            exportPath = PathUtil.join(System.getProperty("user.home"), "zstack-inventory-query-details");
        }

        if (basePkgs == null || basePkgs.isEmpty()) {
            basePkgs = new ArrayList<String>(1);
            basePkgs.add("org.zstack");
        }

        FileUtils.deleteDirectory(new File(exportPath));
        File folder = new File(exportPath);
        folder.mkdirs();

        String folderName = folder.getAbsolutePath();
        ClassPathScanningCandidateComponentProvider scanner = new ClassPathScanningCandidateComponentProvider(false);
        scanner.addIncludeFilter(new AnnotationTypeFilter(Inventory.class));
        scanner.addExcludeFilter(new AnnotationTypeFilter(Controller.class));
        scanner.addExcludeFilter(new AnnotationTypeFilter(Component.class));
        for (String pkg : basePkgs) {
            for (BeanDefinition bd : scanner.findCandidateComponents(pkg)) {
                Class<?> clazz = Class.forName(bd.getBeanClassName());
                generateInventoryDetails(folderName, clazz);
            }
        }
    } catch (Exception e) {
        throw new CloudRuntimeException(e);
    }
}
 
Example 13
Source File: OpenAPIGenerator.java    From spring-openapi with MIT License 5 votes vote down vote up
private Map<String, PathItem> createPathExtensions() {
ClassPathScanningCandidateComponentProvider scanner = createClassPathScanningCandidateComponentProvider();
scanner.addIncludeFilter(new AnnotationTypeFilter(RestController.class));

      List<Class<?>> controllerClasses = new ArrayList<>();
      List<String> packagesWithoutRegex = removeRegexFormatFromPackages(controllerBasePackages);
      for (String controllerPackage : packagesWithoutRegex) {
          logger.debug("Scanning controller package=[{}]", controllerPackage);
          for (BeanDefinition beanDefinition : scanner.findCandidateComponents(controllerPackage)) {
              logger.debug("Scanning controller class=[{}]", beanDefinition.getBeanClassName());
              controllerClasses.add(getClass(beanDefinition));
          }
      }
      return operationsTransformer.transformOperations(controllerClasses);
  }
 
Example 14
Source File: EurekaServerAutoConfiguration.java    From didi-eureka-server with MIT License 5 votes vote down vote up
/**
 * Construct a Jersey {@link javax.ws.rs.core.Application} with all the resources
 * required by the Eureka server.
 */
@Bean
public javax.ws.rs.core.Application jerseyApplication(Environment environment,
		ResourceLoader resourceLoader) {

	ClassPathScanningCandidateComponentProvider provider = new ClassPathScanningCandidateComponentProvider(
			false, environment);

	// Filter to include only classes that have a particular annotation.
	//
	provider.addIncludeFilter(new AnnotationTypeFilter(Path.class));
	provider.addIncludeFilter(new AnnotationTypeFilter(Provider.class));

	// Find classes in Eureka packages (or subpackages)
	//
	Set<Class<?>> classes = new HashSet<Class<?>>();
	for (String basePackage : EUREKA_PACKAGES) {
		Set<BeanDefinition> beans = provider.findCandidateComponents(basePackage);
		for (BeanDefinition bd : beans) {
			Class<?> cls = ClassUtils.resolveClassName(bd.getBeanClassName(),
					resourceLoader.getClassLoader());
			classes.add(cls);
		}
	}

	// Construct the Jersey ResourceConfig
	//
	Map<String, Object> propsAndFeatures = new HashMap<String, Object>();
	propsAndFeatures.put(
			// Skip static content used by the webapp
			ServletContainer.PROPERTY_WEB_PAGE_CONTENT_REGEX,
			EurekaConstants.DEFAULT_PREFIX + "/(fonts|images|css|js)/.*");

	DefaultResourceConfig rc = new DefaultResourceConfig(classes);
	rc.setPropertiesAndFeatures(propsAndFeatures);

	return rc;
}
 
Example 15
Source File: ExternalSources.java    From teiid-spring-boot with Apache License 2.0 5 votes vote down vote up
public void loadConnctionFactories(ClassLoader classloader, String packageName) {
    ClassPathScanningCandidateComponentProvider provider = new ClassPathScanningCandidateComponentProvider(false);
    provider.setResourceLoader(new ResourceLoader() {
        @Override
        public org.springframework.core.io.Resource getResource(String location) {
            return null;
        }
        @Override
        public ClassLoader getClassLoader() {
            return classloader;
        }
    });
    provider.addIncludeFilter(new AnnotationTypeFilter(ConnectionFactoryConfiguration.class));
    Set<BeanDefinition> components = provider.findCandidateComponents(packageName);
    for (BeanDefinition c : components) {
        try {
            Class<?> clazz = Class.forName(c.getBeanClassName(), false, classloader);
            ConnectionFactoryConfiguration cfc = clazz.getAnnotation(ConnectionFactoryConfiguration.class);
            if(cfc != null) {
                ExternalSource source = build(cfc, clazz);
                for (String name : cfc.otherAliases()) {
                    items.put(name, source);
                }
                items.put(source.getName(), source);
            }
        } catch (ClassNotFoundException e) {
            throw new RuntimeException("failed to load " + c.getBeanClassName());
        }
    }
}
 
Example 16
Source File: BentenActionHandlerFactory.java    From benten with MIT License 5 votes vote down vote up
@PostConstruct
public void init() throws ClassNotFoundException {

    scanner =
            new ClassPathScanningCandidateComponentProvider(false);
    scanner.addIncludeFilter(new AnnotationTypeFilter(ActionHandler.class));

    for (BeanDefinition bd : scanner.findCandidateComponents(""))
    {
        Object object =  applicationContext.getBean(Class.forName(bd.getBeanClassName()));
        actionHandlerMap.put(object.getClass().getAnnotation(ActionHandler.class).action(),(BentenActionHandler) object);
    }
}
 
Example 17
Source File: EurekaServerAutoConfiguration.java    From spring-cloud-netflix with Apache License 2.0 5 votes vote down vote up
/**
 * Construct a Jersey {@link javax.ws.rs.core.Application} with all the resources
 * required by the Eureka server.
 * @param environment an {@link Environment} instance to retrieve classpath resources
 * @param resourceLoader a {@link ResourceLoader} instance to get classloader from
 * @return created {@link Application} object
 */
@Bean
public javax.ws.rs.core.Application jerseyApplication(Environment environment,
		ResourceLoader resourceLoader) {

	ClassPathScanningCandidateComponentProvider provider = new ClassPathScanningCandidateComponentProvider(
			false, environment);

	// Filter to include only classes that have a particular annotation.
	//
	provider.addIncludeFilter(new AnnotationTypeFilter(Path.class));
	provider.addIncludeFilter(new AnnotationTypeFilter(Provider.class));

	// Find classes in Eureka packages (or subpackages)
	//
	Set<Class<?>> classes = new HashSet<>();
	for (String basePackage : EUREKA_PACKAGES) {
		Set<BeanDefinition> beans = provider.findCandidateComponents(basePackage);
		for (BeanDefinition bd : beans) {
			Class<?> cls = ClassUtils.resolveClassName(bd.getBeanClassName(),
					resourceLoader.getClassLoader());
			classes.add(cls);
		}
	}

	// Construct the Jersey ResourceConfig
	Map<String, Object> propsAndFeatures = new HashMap<>();
	propsAndFeatures.put(
			// Skip static content used by the webapp
			ServletContainer.PROPERTY_WEB_PAGE_CONTENT_REGEX,
			EurekaConstants.DEFAULT_PREFIX + "/(fonts|images|css|js)/.*");

	DefaultResourceConfig rc = new DefaultResourceConfig(classes);
	rc.setPropertiesAndFeatures(propsAndFeatures);

	return rc;
}
 
Example 18
Source File: SpringRestConfiguration.java    From galeb with Apache License 2.0 4 votes vote down vote up
private Set<BeanDefinition> allBeansDomain() {
    final ClassPathScanningCandidateComponentProvider provider = new ClassPathScanningCandidateComponentProvider(false);
    provider.addIncludeFilter(new RegexPatternTypeFilter(Pattern.compile(".*")));
    return provider.findCandidateComponents("io.galeb.core.entity");
}
 
Example 19
Source File: Java110ListenerDiscoveryRegistrar.java    From MicroCommunity with Apache License 2.0 4 votes vote down vote up
/**
 * 注册侦听
 * @param metadata
 * @param registry
 */
public void registerListener(AnnotationMetadata metadata,
                             BeanDefinitionRegistry registry) throws NoSuchMethodException, InvocationTargetException, IllegalAccessException {
    ClassPathScanningCandidateComponentProvider scanner = getScanner();
    scanner.setResourceLoader(this.resourceLoader);
    Set<String> basePackages;
    Map<String, Object> attrs = metadata
            .getAnnotationAttributes(Java110ListenerDiscovery.class.getName());

    Object listenerPublishClassObj =  attrs.get("listenerPublishClass");

    Assert.notNull(listenerPublishClassObj,"Java110ListenerDiscovery 没有配置 listenerPublishClass 属性");

    Class<?> listenerPublishClass = (Class<?>) listenerPublishClassObj;

    AnnotationTypeFilter annotationTypeFilter = new AnnotationTypeFilter(
            Java110Listener.class);

    scanner.addIncludeFilter(annotationTypeFilter);
    basePackages = getBasePackages(metadata);

    for (String basePackage : basePackages) {
        Set<BeanDefinition> candidateComponents = scanner
                .findCandidateComponents(basePackage);
        for (BeanDefinition candidateComponent : candidateComponents) {
            if (candidateComponent instanceof AnnotatedBeanDefinition) {
                // verify annotated class is an interface
                AnnotatedBeanDefinition beanDefinition = (AnnotatedBeanDefinition) candidateComponent;
                AnnotationMetadata annotationMetadata = beanDefinition.getMetadata();


                Map<String, Object> attributes = annotationMetadata
                        .getAnnotationAttributes(
                                Java110Listener.class.getCanonicalName());

                String beanName = getListenerName(attributes,beanDefinition);

                /*BeanDefinitionHolder definitionHolder = new BeanDefinitionHolder(beanDefinition, beanName);
                BeanDefinitionReaderUtils.registerBeanDefinition(definitionHolder, registry);*/
                Method method = listenerPublishClass.getMethod("addListener",String.class);
                method.invoke(null,beanName);
            }
        }
    }
}
 
Example 20
Source File: BeanConfigFactoryManager.java    From logsniffer with GNU Lesser General Public License v3.0 4 votes vote down vote up
@SuppressWarnings("unchecked")
@PostConstruct
private void initJsonMapper() {
	final SimpleModule module = new SimpleModule();
	module.setDeserializerModifier(new BeanDeserializerModifier() {
		@Override
		public JsonDeserializer<?> modifyDeserializer(final DeserializationConfig config,
				final BeanDescription beanDesc, final JsonDeserializer<?> deserializer) {
			if (ConfiguredBean.class.isAssignableFrom(beanDesc.getBeanClass())) {
				return new ConfiguredBeanDeserializer(deserializer);
			}
			return deserializer;
		}
	});
	jsonMapper.registerModule(module);
	if (postConstructors != null) {
		for (final BeanPostConstructor<?> bpc : postConstructors) {
			mappedPostConstrucors.put(bpc.getClass(), bpc);
		}
	}

	// Register sub beans
	final ClassPathScanningCandidateComponentProvider scanner = new ClassPathScanningCandidateComponentProvider(
			false);
	final AssignableTypeFilter filter4configBenas = new AssignableTypeFilter(ConfiguredBean.class);
	scanner.addIncludeFilter(filter4configBenas);

	for (final BeanDefinition bd : scanner.findCandidateComponents("com.logsniffer")) {
		try {
			final Class<? extends ConfiguredBean> clazz = (Class<? extends ConfiguredBean>) Class
					.forName(bd.getBeanClassName());
			final JsonTypeName jsonNameAnnotation = clazz.getAnnotation(JsonTypeName.class);
			final List<String> names = new ArrayList<String>();
			configBeanNames.put(clazz, names);
			if (jsonNameAnnotation != null) {
				names.add(jsonNameAnnotation.value());
				if (jsonNameAnnotation.deprecated() != null) {
					for (final String dep : jsonNameAnnotation.deprecated()) {
						names.add(dep);
					}
				}
			}
			names.add(clazz.getSimpleName());
			logger.debug("Registered JSON type {} for following names: {}", clazz, names);
		} catch (final ClassNotFoundException e) {
			logger.warn("Failed to register JSON type name for " + bd.getBeanClassName(), e);
		}
	}
}