|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.cocoon.spring.configurator.impl.BeanMap
This is a map implementation collecting all beans of a specific type (class)
from a spring bean factory.
The beans are available through their configured bean id.
The map has a lazy implementation: the beans are not searched on instantiation
but the first time the map is accessed. This avoids any startup ordering problems.
By default the map searches in the bean factory it is used in and in all the parent
bean factories (if there are any). This behaviour can be changed by calling the
setCheckParent(boolean)
method.
Nested Class Summary |
Nested classes inherited from class java.util.Map |
Map.Entry |
Field Summary | |
protected Class |
beanClass
The class for all beans in this map. |
protected ListableBeanFactory |
beanFactory
The bean factory. |
protected Map |
beanMap
The real map. |
protected boolean |
checkParent
Do we check the parent factories? |
protected List |
hasProperties
Do we check for properties? |
protected boolean |
initialized
Is the map initialized? |
protected String |
keyProperty
Which property should we use to key the map? |
protected boolean |
stripPrefix
Do we strip the prefix from the bean name? |
Constructor Summary | |
BeanMap()
|
Method Summary | |
protected void |
checkInit()
Check if the bean is already initialized. |
void |
clear()
|
boolean |
containsKey(Object key)
|
boolean |
containsValue(Object value)
|
Set |
entrySet()
|
boolean |
equals(Object obj)
|
Object |
get(Object key)
|
protected void |
getBeanNames(ListableBeanFactory factory,
Set beanNames)
Get all bean names for the given type. |
int |
hashCode()
|
boolean |
isEmpty()
|
Set |
keySet()
|
protected void |
load(Set beanNames)
Get all the bean's from the bean factory and put them into a map using their id. |
Object |
put(Object key,
Object value)
|
void |
putAll(Map t)
|
Object |
remove(Object key)
|
void |
setBeanFactory(BeanFactory factory)
|
void |
setCheckParent(boolean checkParent)
|
void |
setHasProperties(String pHasProperties)
|
void |
setKeyProperty(String pKeyProperty)
|
void |
setStripPrefix(boolean stripPrefix)
|
void |
setType(Class typeClass)
|
int |
size()
|
String |
toString()
|
Collection |
values()
|
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
protected Map beanMap
protected boolean initialized
protected ListableBeanFactory beanFactory
protected Class beanClass
protected boolean stripPrefix
protected boolean checkParent
protected List hasProperties
protected String keyProperty
Constructor Detail |
public BeanMap()
Method Detail |
protected void load(Set beanNames)
beanNames
- The bean names to load.protected void checkInit()
protected void getBeanNames(ListableBeanFactory factory, Set beanNames)
factory
- The bean factory.beanNames
- The set containing the resulting bean names.public void setBeanFactory(BeanFactory factory) throws BeansException
setBeanFactory
in interface BeanFactoryAware
BeansException
BeanFactoryAware.setBeanFactory(org.springframework.beans.factory.BeanFactory)
public void setStripPrefix(boolean stripPrefix)
public void setCheckParent(boolean checkParent)
public void setHasProperties(String pHasProperties)
public void setKeyProperty(String pKeyProperty)
public void setType(Class typeClass)
public void clear()
clear
in interface Map
Map.clear()
public boolean containsKey(Object key)
containsKey
in interface Map
Map.containsKey(java.lang.Object)
public boolean containsValue(Object value)
containsValue
in interface Map
Map.containsValue(java.lang.Object)
public Set entrySet()
entrySet
in interface Map
Map.entrySet()
public Object get(Object key)
get
in interface Map
Map.get(java.lang.Object)
public boolean isEmpty()
isEmpty
in interface Map
Map.isEmpty()
public Set keySet()
keySet
in interface Map
Map.keySet()
public Object put(Object key, Object value)
put
in interface Map
Map.put(java.lang.Object, java.lang.Object)
public void putAll(Map t)
putAll
in interface Map
Map.putAll(java.util.Map)
public Object remove(Object key)
remove
in interface Map
Map.remove(java.lang.Object)
public int size()
size
in interface Map
Map.size()
public Collection values()
values
in interface Map
Map.values()
public boolean equals(Object obj)
equals
in interface Map
Object.equals(java.lang.Object)
public int hashCode()
hashCode
in interface Map
Object.hashCode()
public String toString()
Object.toString()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |