|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.weblab_project.core.helper.BeanHelper
public abstract class BeanHelper
Abstract class which enable to load dynamically the implementation. It aims to load JAVA bean in accordance to a configuration file.
Field Summary | |
---|---|
static java.lang.String |
FILENAME
The properties file used. |
Constructor Summary | |
---|---|
protected |
BeanHelper()
The default constructor to be called by implementations. |
Method Summary | ||
---|---|---|
abstract
|
getBean(java.lang.String name,
java.lang.Class<T> beanClass)
Get the bean defined by its name in the configuration file. |
|
static BeanHelper |
getInstance()
|
|
abstract BeanHelper |
getSpecificInstance(java.lang.String path)
Return the current instance of Bean factory with respect to the configuration file. |
|
abstract BeanHelper |
getSpecificInstance(java.lang.String fileNameOrPath,
boolean isName)
This method is similar to getSpecificInstance(String) but when name is true , it's loaded from the classpath, without
the whole path if possible. |
|
abstract boolean |
isBeanDefined(java.lang.String name,
java.lang.Class<?> beanClass)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String FILENAME
Constructor Detail |
---|
protected BeanHelper()
Method Detail |
---|
public static BeanHelper getInstance()
BeanHelper
instance.public abstract BeanHelper getSpecificInstance(java.lang.String path)
path
- The path to the configuration file.
BeanHelper
in accordance with the configuration file.getSpecificInstance(String, boolean)
public abstract BeanHelper getSpecificInstance(java.lang.String fileNameOrPath, boolean isName)
getSpecificInstance(String)
but when name
is true
, it's loaded from the classpath, without
the whole path if possible.
fileNameOrPath
- The name of (or the path to) the configuration file.isName
- Whether fileNameOrPath
is a name or a path.
BeanHelper
in accordance with the configuration file.getSpecificInstance(String)
public abstract <T> T getBean(java.lang.String name, java.lang.Class<T> beanClass)
T
- The class of the bean to be instantiatedname
- The name of the bean to retrieve.beanClass
- The class of the bean to be instantiated.
name
in the BeanHelper
.
org.weblab_project.core.exception.WebLabUncheckedException
- If bean does not exist in configuration file loaded.public abstract boolean isBeanDefined(java.lang.String name, java.lang.Class<?> beanClass)
name
- The name of the bean to test existence in the configuration file.beanClass
- The class of the bean.
name
and of a type (or subtype, or implementation) or beanClass
exists in configuration
file.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |