Spring Framework StandardAnnotationMetadata - 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 StandardAnnotationMetadata class.

This code example shows how to use the following methods:
	 * Create a new AnnotatedGenericBeanDefinition for the given bean class. 
	 * @param beanClass the loaded bean class 
	public AnnotatedGenericBeanDefinition(Class<?> beanClass) {
		this.metadata = new StandardAnnotationMetadata(beanClass, true);
	 * Create a new AnnotatedGenericBeanDefinition for the given annotation metadata, 
	 * allowing for ASM-based processing and avoidance of early loading of the bean class. 
	 * Note that this constructor is functionally equivalent to 
	 * {@link org.springframework.context.annotation.ScannedGenericBeanDefinition 
	 * ScannedGenericBeanDefinition}, however the semantics of the latter indicate that a 
	 * bean was discovered specifically via component-scanning as opposed to other means. 
	 * @param metadata the annotation metadata for the bean class in question 
	 * @since 3.1.1 
	public AnnotatedGenericBeanDefinition(AnnotationMetadata metadata) {
		Assert.notNull(metadata, "AnnotationMetadata must not be null");
This code example shows how to use the following methods:
		assertThat(getConfigSource(DefaultConfiguration.class).usesExplicitFilters(), is(false)); 
	private AnnotationRepositoryConfigurationSource getConfigSource(Class<?> type) {
		AnnotationMetadata metadata = new StandardAnnotationMetadata(type, true);
		return new AnnotationRepositoryConfigurationSource(metadata, EnableRepositories.class, resourceLoader, environment);
	public static class Person {} 
	static class DefaultConfiguration {} 
	@EnableRepositories(basePackages = "foo", namedQueriesLocation = "bar") 
	static class DefaultConfigurationWithBasePackage {} 
	@EnableRepositories(considerNestedRepositories = true) 
	static class DefaultConfigurationWithNestedRepositories {} 
This code example shows how to use the following methods:
	AnnotationMetadata metadata;
	public void setUp() { 
		metadata = new StandardAnnotationMetadata(Config.class, true);
		registry = new DefaultListableBeanFactory();
	public void configuresRepositoriesCorrectly() { 
		JpaRepositoriesRegistrar registrar = new JpaRepositoriesRegistrar();
		registrar.setResourceLoader(new DefaultResourceLoader());
		registrar.setEnvironment(new StandardEnvironment());
		registrar.registerBeanDefinitions(metadata, registry);
		Iterable<String> names = Arrays.asList(registry.getBeanDefinitionNames());
		assertThat(names, hasItems("userRepository", "auditableUserRepository", "roleRepository"));