Spring Framework ClassPathBeanDefinitionScanner - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Spring Framework ClassPathBeanDefinitionScanner class.

This code example shows how to use the following methods:buildGenericDataProviderDefinition, buildGenericRepositoryDefinition, registerBeanDefinition
            } 
            else if (clazz.isAnnotationPresent(NavigationBox.class)) {
                moduleConfiguration.addBox(new BoxConfiguration(clazz));
            } 
            else if (clazz.isAnnotationPresent(GenericRepository.class)) {
                BeanDefinitionHolder beanDefinitionHolder = buildGenericRepositoryDefinition(clazz);
                super.registerBeanDefinition(beanDefinitionHolder, registry);
            } 
            else if (clazz.isAnnotationPresent(Entity.class)
                    || clazz.isAnnotationPresent(org.hibernate.annotations.Entity.class)) {
                moduleConfiguration.addEntity(clazz);
                if (clazz.isAnnotationPresent(RegisterGenericDataProvider.class)) {
                    BeanDefinitionHolder beanDefinitionHolder = buildGenericDataProviderDefinition(clazz);
                    super.registerBeanDefinition(beanDefinitionHolder, registry);
                } 
            } 
            else { 
                super.registerBeanDefinition(definitionHolder, registry);
            } 
 

5
CodeRank
This code example shows how to use the following methods:isCandidateComponent
		this.descriptor = descriptor;
	} 
 
	@Override 
	protected boolean isCandidateComponent(final MetadataReader metadataReader) throws IOException {
		return super.isCandidateComponent(metadataReader) && matchesAlfrescoVersion(metadataReader);
	} 
 
	private boolean matchesAlfrescoVersion(final MetadataReader metadataReader) {
		boolean matches = true;
		final AnnotationMetadata metadata = metadataReader.getAnnotationMetadata();
		if (metadata.isAnnotated(AlfrescoPlatform.class.getName())) {
			final Map<String, Object> alfrescoVersion = metadata.getAnnotationAttributes(AlfrescoPlatform.class
					.getName());
			final String minVersion = (String) alfrescoVersion.get("minVersion");
			final String maxVersion = (String) alfrescoVersion.get("maxVersion");
			final VersionNumber versionNumber = descriptor.getVersionNumber();
			if (StringUtils.hasText(minVersion) && versionNumber.compareTo(new VersionNumber(minVersion)) < 0) {
				matches = false;
			} else if (StringUtils.hasText(maxVersion) && versionNumber.compareTo(new VersionNumber(maxVersion)) > 0) {
4
CodeRank
This code example shows how to use the following methods:scan
 
		ctx = new GenericApplicationContext();
		ctx.registerShutdownHook();
		configureApplicationContext(ctx);
		// built-in commands and converters 
		ClassPathBeanDefinitionScanner scanner = new ClassPathBeanDefinitionScanner(ctx);
		if (commandLine.getDisableInternalCommands()) {
			scanner.scan("org.springframework.shell.converters", "org.springframework.shell.plugin.support");
		} 
		else { 
			scanner.scan("org.springframework.shell.commands", "org.springframework.shell.converters",
					"org.springframework.shell.plugin.support"); 
		} 
		// user contributed commands 
		XmlBeanDefinitionReader reader = new XmlBeanDefinitionReader(ctx);
		reader.loadBeanDefinitions(contextPath);
		ctx.refresh();
	} 
 
	public ApplicationContext getApplicationContext() {
4
CodeRank
See Code Examples for Spring Framework ClassPathBeanDefinitionScanner Methods: