org.springframework.config.java.naming
Class ChainedStrategy

java.lang.Object
  extended by org.springframework.config.java.naming.ChainedStrategy
All Implemented Interfaces:
BeanNamingStrategy

public class ChainedStrategy
extends java.lang.Object
implements BeanNamingStrategy

Chain-like implementation naming strategy.

Allows a stack of strategies to be specified, returning the first non-null name.

Author:
Costin Leau

Constructor Summary
ChainedStrategy(BeanNamingStrategy[] strategies)
           
 
Method Summary
 java.lang.String getBeanName(ModelMethod beanCreationMethod)
          Create the bean name based on the given method.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ChainedStrategy

public ChainedStrategy(BeanNamingStrategy[] strategies)
Method Detail

getBeanName

public java.lang.String getBeanName(ModelMethod beanCreationMethod)
Description copied from interface: BeanNamingStrategy
Create the bean name based on the given method. If more contextual information is needed, consider using the ModelMethod API to get access to it or provide hooks inside the implementations.

Specified by:
getBeanName in interface BeanNamingStrategy
Parameters:
beanCreationMethod - the method which creates the actual bean instance
Returns:
the bean name