org.springframework.config.java.naming
Class MethodNameStrategy

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

public class MethodNameStrategy
extends Object
implements BeanNamingStrategy

Naming strategy which uses the method name for generating the bean name. Allows configuration for include the owning class short name or FQN as well.

Author:
Costin Leau

Nested Class Summary
static class MethodNameStrategy.Prefix
          Naming prefix.
 
Constructor Summary
MethodNameStrategy()
          Default, empty constructor.
MethodNameStrategy(MethodNameStrategy.Prefix prefix)
          Constructor allowing the naming prefix to be specified.
 
Method Summary
 String getBeanName(Method beanCreationMethod)
          Create the bean name based on the given method.
 void setPrefix(MethodNameStrategy.Prefix prefix)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MethodNameStrategy

public MethodNameStrategy()
Default, empty constructor.


MethodNameStrategy

public MethodNameStrategy(MethodNameStrategy.Prefix prefix)
Constructor allowing the naming prefix to be specified.

Parameters:
prefix - naming prefix
Method Detail

getBeanName

public String getBeanName(Method beanCreationMethod)
Description copied from interface: BeanNamingStrategy
Create the bean name based on the given method. If more contextual information is needed, consider using the Method 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

setPrefix

public void setPrefix(MethodNameStrategy.Prefix prefix)


Copyright � 2005-2008 Spring Framework. All Rights Reserved.