public class MapBasedMethodDefinitionSource extends AbstractFallbackMethodDefinitionSource implements org.springframework.beans.factory.BeanClassLoaderAware
ConfigAttributeDefinition
for a method or class signature.
This class is the preferred implementation of MethodDefinitionSource
for XML-based
definition of method security metadata. To assist in XML-based definition, wildcard support
is provided.
Modifier and Type | Field and Description |
---|---|
protected java.util.Map |
methodMap
Map from RegisteredMethod to ConfigAttributeDefinition
|
Constructor and Description |
---|
MapBasedMethodDefinitionSource() |
MapBasedMethodDefinitionSource(java.util.Map methodMap)
Creates the MapBasedMethodDefinitionSource from a
|
Modifier and Type | Method and Description |
---|---|
void |
addSecureMethod(java.lang.Class javaType,
java.lang.reflect.Method method,
ConfigAttributeDefinition attr)
Adds configuration attributes for a specific method, for example where the method has been
matched using a pointcut expression.
|
void |
addSecureMethod(java.lang.Class javaType,
java.lang.String mappedName,
ConfigAttributeDefinition attr)
Add configuration attributes for a secure method.
|
void |
addSecureMethod(java.lang.String name,
ConfigAttributeDefinition attr)
Add configuration attributes for a secure method.
|
protected ConfigAttributeDefinition |
findAttributes(java.lang.Class clazz)
Implementation does not support class-level attributes.
|
protected ConfigAttributeDefinition |
findAttributes(java.lang.reflect.Method method,
java.lang.Class targetClass)
Will walk the method inheritance tree to find the most specific declaration applicable.
|
java.util.Collection |
getConfigAttributeDefinitions()
Obtains the configuration attributes explicitly defined against this bean.
|
int |
getMethodMapSize() |
void |
setBeanClassLoader(java.lang.ClassLoader beanClassLoader) |
getAttributes, getAttributes, supports
protected java.util.Map methodMap
public MapBasedMethodDefinitionSource()
public MapBasedMethodDefinitionSource(java.util.Map methodMap)
methodMap
- map of method names to ConfigAttributeDefinitions.protected ConfigAttributeDefinition findAttributes(java.lang.Class clazz)
findAttributes
in class AbstractFallbackMethodDefinitionSource
clazz
- the target class for the invocation (never null
)protected ConfigAttributeDefinition findAttributes(java.lang.reflect.Method method, java.lang.Class targetClass)
findAttributes
in class AbstractFallbackMethodDefinitionSource
method
- the method for the current invocation (never null
)targetClass
- the target class for the invocation (may be null
)public void addSecureMethod(java.lang.String name, ConfigAttributeDefinition attr)
*
for matching multiple methods.name
- type and method name, separated by a dotattr
- required authorities associated with the methodpublic void addSecureMethod(java.lang.Class javaType, java.lang.String mappedName, ConfigAttributeDefinition attr)
*
for matching multiple methods.javaType
- target interface or class the security configuration attribute applies tomappedName
- mapped method name, which the javaType has declared or inheritedattr
- required authorities associated with the methodpublic void addSecureMethod(java.lang.Class javaType, java.lang.reflect.Method method, ConfigAttributeDefinition attr)
public java.util.Collection getConfigAttributeDefinitions()
getConfigAttributeDefinitions
in interface ObjectDefinitionSource
public void setBeanClassLoader(java.lang.ClassLoader beanClassLoader)
setBeanClassLoader
in interface org.springframework.beans.factory.BeanClassLoaderAware
public int getMethodMapSize()