|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object ch.elca.el4j.core.beans.BeanLocator
public class BeanLocator
Locates all beans in the application context that match the configured criteria.
classes
property a comma-separated list of classes
whose instances to include in the result can be specified.excludeBeanNames
property a comma-separated list
of bean names to exclude from the result can be specified.includeBeanNames
property a comma-separated list
of bean names to include in the result can be specified.includeFactoryBeans
property it is specified if
FactoryBeans should be included in the result. Default value = true.includePrototypes
property it is specified if
prototype beans should be included in the result. Default value = true.excludeBeanNames
and includeBeanNames
properties wildcards xxx*
and *xxx
are allowed.
If a bean is listed in includeBeanNames
and
excludeBeanNames
it will be excluded.
Beans which exist in application context and are listed in
includeBeanNames
but are not an instance of a listed class in
classes
will be also returned on invocation of method
getBeans
.
Constructor Summary | |
---|---|
BeanLocator()
|
Method Summary | |
---|---|
void |
afterPropertiesSet()
|
Map<String,Object> |
getBeans()
Returns all beans that match the specified search criteria. |
protected boolean |
isMatch(String beanName,
String mappedName)
Returns whether the given bean name matches the mapped name. |
void |
setApplicationContext(ApplicationContext applicationContext)
|
void |
setClasses(String classes)
|
void |
setExcludeBeanNames(String excludeBeanNames)
|
void |
setIncludeBeanNames(String includeBeanNames)
|
void |
setIncludeFactoryBeans(boolean includeFactoryBeans)
|
void |
setIncludePrototypes(boolean includePrototypes)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public BeanLocator()
Method Detail |
---|
public void setClasses(String classes)
classes
- The comma-delimited String of all the classes whose instances
have to be located.public void setExcludeBeanNames(String excludeBeanNames)
excludeBeanNames
- The comma-delimited String of all bean names that have to be
excluded from the result.public void setIncludeBeanNames(String includeBeanNames)
includeBeanNames
- The comma-delimited String of all bean names that have to be
included in the result.public void setIncludeFactoryBeans(boolean includeFactoryBeans)
includeFactoryBeans
- Whether to include FactoryBeans too or just conventional
beans.public void setIncludePrototypes(boolean includePrototypes)
includePrototypes
- Whether to include prototype beans too or just singletons
(also applies to FactoryBeans).public void setApplicationContext(ApplicationContext applicationContext)
setApplicationContext
in interface ApplicationContextAware
public void afterPropertiesSet() throws Exception
afterPropertiesSet
in interface InitializingBean
Exception
public Map<String,Object> getBeans()
protected boolean isMatch(String beanName, String mappedName)
beanName
- The bean name to check.mappedName
- The name in the configured list of names.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |