Java Code Examples for org.springframework.beans.factory.parsing.AliasDefinition

The following examples show how to use org.springframework.beans.factory.parsing.AliasDefinition. These examples are extracted from open source projects. 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 Project: spring-analysis-note   Source File: EventPublicationTests.java    License: MIT License 5 votes vote down vote up
@Test
public void aliasEventReceived() throws Exception {
	List aliases = this.eventListener.getAliases("testBean");
	assertEquals(2, aliases.size());
	AliasDefinition aliasDefinition1 = (AliasDefinition) aliases.get(0);
	assertEquals("testBeanAlias1", aliasDefinition1.getAlias());
	assertTrue(aliasDefinition1.getSource() instanceof Element);
	AliasDefinition aliasDefinition2 = (AliasDefinition) aliases.get(1);
	assertEquals("testBeanAlias2", aliasDefinition2.getAlias());
	assertTrue(aliasDefinition2.getSource() instanceof Element);
}
 
Example 2
@Override
public void aliasRegistered(AliasDefinition aliasDefinition) {
	List<AliasDefinition> aliases = this.aliasMap.get(aliasDefinition.getBeanName());
	if (aliases == null) {
		aliases = new ArrayList<>();
		this.aliasMap.put(aliasDefinition.getBeanName(), aliases);
	}
	aliases.add(aliasDefinition);
}
 
Example 3
Source Project: java-technology-stack   Source File: EventPublicationTests.java    License: MIT License 5 votes vote down vote up
@Test
public void aliasEventReceived() throws Exception {
	List aliases = this.eventListener.getAliases("testBean");
	assertEquals(2, aliases.size());
	AliasDefinition aliasDefinition1 = (AliasDefinition) aliases.get(0);
	assertEquals("testBeanAlias1", aliasDefinition1.getAlias());
	assertTrue(aliasDefinition1.getSource() instanceof Element);
	AliasDefinition aliasDefinition2 = (AliasDefinition) aliases.get(1);
	assertEquals("testBeanAlias2", aliasDefinition2.getAlias());
	assertTrue(aliasDefinition2.getSource() instanceof Element);
}
 
Example 4
@Override
public void aliasRegistered(AliasDefinition aliasDefinition) {
	List<AliasDefinition> aliases = this.aliasMap.get(aliasDefinition.getBeanName());
	if (aliases == null) {
		aliases = new ArrayList<>();
		this.aliasMap.put(aliasDefinition.getBeanName(), aliases);
	}
	aliases.add(aliasDefinition);
}
 
Example 5
@Test
public void aliasEventReceived() throws Exception {
	List aliases = this.eventListener.getAliases("testBean");
	assertEquals(2, aliases.size());
	AliasDefinition aliasDefinition1 = (AliasDefinition) aliases.get(0);
	assertEquals("testBeanAlias1", aliasDefinition1.getAlias());
	assertTrue(aliasDefinition1.getSource() instanceof Element);
	AliasDefinition aliasDefinition2 = (AliasDefinition) aliases.get(1);
	assertEquals("testBeanAlias2", aliasDefinition2.getAlias());
	assertTrue(aliasDefinition2.getSource() instanceof Element);
}
 
Example 6
public List<AliasDefinition> getAliases(String beanName) {
	List<AliasDefinition> aliases = this.aliasMap.get(beanName);
	return (aliases != null ? Collections.unmodifiableList(aliases) : null);
}
 
Example 7
public List<AliasDefinition> getAliases(String beanName) {
	List<AliasDefinition> aliases = this.aliasMap.get(beanName);
	return (aliases != null ? Collections.unmodifiableList(aliases) : null);
}
 
Example 8
public void aliasRegistered(AliasDefinition alias) {
   if(! aliases.containsKey(alias.getAlias())) {
      aliases.put(alias.getAlias(), alias.getBeanName());
   }
}
 
Example 9
@Override
public void aliasRegistered(AliasDefinition aliasDefinition) {
	log.info("Registered alias [" + aliasDefinition.getAlias() + "] for bean " + aliasDefinition.getBeanName());
}
 
Example 10
@Override
public void aliasRegistered(AliasDefinition aliasDefinition) {
	log.info("Registered alias [" + aliasDefinition.getAlias() + "] for bean " + aliasDefinition.getBeanName());
}