|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.sourceforge.jpatterns.patterns.PatternBase com.sourceforge.jpatterns.patterns.factory.JPFactoryImpl
public class JPFactoryImpl
The default implementation of the IJPFactory
interface.
Field Summary | |
---|---|
static org.apache.log4j.Logger |
LOG
Logger instance. |
Fields inherited from class com.sourceforge.jpatterns.patterns.PatternBase |
---|
m_castorSection, m_configBean |
Constructor Summary | |
---|---|
JPFactoryImpl()
|
Method Summary | |
---|---|
boolean |
check()
|
boolean |
checkCastorConfig(com.sourceforge.jpatterns.schema.CastorSectionType castorSectionType)
Make the check this type of the castor config fits the pattern |
Object |
getImplementation(Class interfaceClass,
String scope)
Get implementation of the interface defined by the given class and the scope we need to obtain. |
Object |
getImplementation(Class interfaceClass,
String implType,
String scope)
Get implementation of the interface defined by the given class and the scope we need to obtain. |
Object |
getImplementation(String interfaceClassBaseName,
String scope)
Get implementation of the interface defined by the given class (class of the interface). |
Object |
getImplementation(String interfaceClassBaseName,
String implType,
String scope)
Get implementation of the interface defined by the given class (class of the interface). |
String |
getImplementationFullName(Class interfaceClass,
String scope)
Get the full name of the implementation of the interface defined by the given class and the scope we need to obtain. |
String |
getImplementationFullName(String interfaceClassBaseName,
String scope)
Get the full name of the implementation of the interface defined by the given class (class of the interface). |
Map<String,Object> |
getImplementations(Class interfaceClass,
String scope)
Get the Map of implementations of the interface defined by the given class and the scope we need to obtain. |
Map<String,Object> |
getImplementations(String interfaceClassBaseName,
String scope)
Get the Map of implementations of the interface defined by the given class and the scope we need to obtain. |
Map<String,String> |
getImplementationsFullNames(Class interfaceClass,
String scope)
Get the Map of implementations of the interface defined by the given class and the scope we need to obtain. |
Map<String,String> |
getImplementationsFullNames(String interfaceClassBaseName,
String scope)
Get the Map of implementations of the interface defined by the given class and the scope we need to obtain. |
protected Map<String,String> |
getImplementationsNamesByItem(com.sourceforge.jpatterns.schema.Item item)
Instantiate the Object using the provided item |
Object |
getOperator(Class productBaseClass,
Class operatorBaseClass,
Object productObj,
String scope)
The the operator for the provided object and scope. |
Map<Object,Object> |
getOperators(Class productBaseClass,
Class operatorBaseClass,
List<Object> productObjs,
String scope)
Get the mappings between the operators (which would be created at this methods) and the List of the products objects provided here. |
protected com.sourceforge.jpatterns.schema.Param |
getParam(com.sourceforge.jpatterns.schema.Item item,
String key)
Get Param castor object by the key. |
protected Object |
instantiateObjectByItem(com.sourceforge.jpatterns.schema.Item item,
Class claz)
Instantiate the Object using the provided item. |
protected Object |
instantiateObjectByItemAndType(com.sourceforge.jpatterns.schema.Item item,
String type,
Class claz)
Instantiate the Object using the provided item and the type we need |
protected Map<String,Object> |
validateImplementationsMap(Class clazz,
Map<String,Object> map)
Check that all the implementations of the map - are the types of the provided class. |
Methods inherited from class com.sourceforge.jpatterns.patterns.PatternBase |
---|
getActualScope, init, logAndThrow, retrieveItem |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface com.sourceforge.jpatterns.patterns.IJPattern |
---|
init |
Field Detail |
---|
public static final org.apache.log4j.Logger LOG
Constructor Detail |
---|
public JPFactoryImpl()
Method Detail |
---|
public boolean checkCastorConfig(com.sourceforge.jpatterns.schema.CastorSectionType castorSectionType)
IJPattern
checkCastorConfig
in interface IJPattern
checkCastorConfig
in class PatternBase
castorSectionType
- the castor config object which is the root configuration storage for all the patterns (according to the XSD scheme)
IJPattern.checkCastorConfig(com.sourceforge.jpatterns.schema.CastorSectionType)
public Object getImplementation(Class interfaceClass, String scope)
IJPFactory
getImplementation
in interface IJPFactory
interfaceClass
- the class representing the interface
Can not be null (otherwise IllegalArgumentException
would appear).scope
- the scope where do we need to find the implementation. In the case this is null -
the default value for scope would be used (would be taken from factory object)
IJPFactory.getImplementation(java.lang.Class,java.lang.String)
public Object getImplementation(String interfaceClassBaseName, String scope)
IJPFactory
getImplementation
in interface IJPFactory
interfaceClassBaseName
- the base name of the interface (e.g. IJPFactory
), also it could be just String key
(just logical case for which we need to obtain smth.)scope
- the scope where do we need to find the implementation. In the case this is null -
the default value for scope would be used (would be taken from factory object)
IJPFactory.getImplementation(java.lang.Class,java.lang.String)
public String getImplementationFullName(Class interfaceClass, String scope)
IJPFactory
getImplementationFullName
in interface IJPFactory
interfaceClass
- the class representing the interface
Can not be null (otherwise IllegalArgumentException
would appear).scope
- the scope where do we need to find the implementation. In the case this is null -
the default value for scope would be used (would be taken from factory object)
IJPFactory.getImplementationFullName(Class,String)
public String getImplementationFullName(String interfaceClassBaseName, String scope)
IJPFactory
getImplementationFullName
in interface IJPFactory
interfaceClassBaseName
- the base name of the interface (e.g. IJPFactory
)scope
- the scope where do we need to find the implementation. In the case this is null -
the default value for scope would be used (would be taken from factory object)
IJPFactory.getImplementationFullName(String,String)
public Object getImplementation(Class interfaceClass, String implType, String scope)
IJPFactory
getImplementation
in interface IJPFactory
interfaceClass
- the class representing the interface
Can not be null (otherwise IllegalArgumentException
would appear).implType
- the type of implementationscope
- the scope where do we need to find the implementation. In the case this is null -
the default value for scope would be used (would be taken from factory object)
IJPFactory.getImplementation(java.lang.Class,java.lang.String,java.lang.String)
public Object getImplementation(String interfaceClassBaseName, String implType, String scope)
IJPFactory
getImplementation
in interface IJPFactory
interfaceClassBaseName
- the base name of the interface (e.g. IJPFactory
)implType
- the type of implementationscope
- the scope where do we need to find the implementation. In the case this is null -
the default value for scope would be used (would be taken from factory object)
IJPFactory.getImplementation(java.lang.String,java.lang.String,java.lang.String)
public Map<String,Object> getImplementations(Class interfaceClass, String scope)
IJPFactory
getImplementations
in interface IJPFactory
interfaceClass
- the class representing the interface
Can not be null (otherwise IllegalArgumentException
would appear).scope
- the scope where do we need to find the implementation. In the case this is null -
the default value for scope would be used (would be taken from factory object)
IJPFactory.getImplementations(Class,String)
public Map<String,Object> getImplementations(String interfaceClassBaseName, String scope)
IJPFactory
getImplementations
in interface IJPFactory
interfaceClassBaseName
- the base name of the interface (e.g. IJPFactory
)scope
- the scope where do we need to find the implementation. In the case this is null -
the default value for scope would be used (would be taken from factory object)
IJPFactory.getImplementations(String,String)
public Map<String,String> getImplementationsFullNames(Class interfaceClass, String scope)
IJPFactory
getImplementationsFullNames
in interface IJPFactory
interfaceClass
- the class representing the interface
Can not be null (otherwise IllegalArgumentException
would appear).scope
- the scope where do we need to find the implementation. In the case this is null -
the default value for scope would be used (would be taken from factory object)
IJPFactory.getImplementationsFullNames(Class,String)
public Map<String,String> getImplementationsFullNames(String interfaceClassBaseName, String scope)
IJPFactory
getImplementationsFullNames
in interface IJPFactory
interfaceClassBaseName
- the base name of the interface (e.g. IJPFactory
)scope
- the scope where do we need to find the implementation. In the case this is null -
the default value for scope would be used (would be taken from factory object)
IJPFactory.getImplementationsFullNames(String,String)
public Object getOperator(Class productBaseClass, Class operatorBaseClass, Object productObj, String scope)
IJPFactory
getOperator
in interface IJPFactory
productBaseClass
- the interface or base class of the product for which we are finding the implementation of the operator.
Still the actual class of the product provided would be used too. Can not be null (otherwise
IllegalArgumentException
would appear).operatorBaseClass
- the interface of the base class of the operator we would need to obtain the appropriate configuration item.
Be noticed this base class defines the scope we need to consider to obtain the necessary operator
Can not be null (otherwise IllegalArgumentException
would appear).productObj
- the product for which we need the implementation. This product should of the
productBaseClass
class
Can not be null (otherwise IllegalArgumentException
would appear).scope
- the scope where do we need to find the implementation. In the case this is null -
the default value for scope would be used (would be taken from factory object)
IJPFactory.getOperator(Class,Class,Object, String)
public Map<Object,Object> getOperators(Class productBaseClass, Class operatorBaseClass, List<Object> productObjs, String scope)
IJPFactory
getOperators
in interface IJPFactory
productBaseClass
- the interface or base class of the product for which we are finding the implementation of the operator.
Still the actual class of the product provided would be used too. Can not be null (otherwise
IllegalArgumentException
would appear).operatorBaseClass
- the interface of the base class of the operator we would need to obtain the appropriate configuration item.
Be noticed this base class defines the scope we need to consider to obtain the necessary operator
Can not be null (otherwise IllegalArgumentException
would appear).productObjs
- the List of the products for which we need to obtain the appropriate operators. These products should of the
productBaseClass
class. Can not be null (otherwise IllegalArgumentException
would appear).scope
- the scope where do we need to find the implementation. In the case this is null -
the default value for scope would be used (would be taken from factory object)
productObjs
list) and
the appropriate operators.IJPFactory.getOperators(Class,Class,java.util.List, String)
public boolean check()
check
in interface com.zmicer.utils.model.ICheckable
check
in class PatternBase
ICheckable.check()
protected com.sourceforge.jpatterns.schema.Param getParam(com.sourceforge.jpatterns.schema.Item item, String key)
Param
castor object by the key.
item
- the castor Item
. Can not be null (otherwise IllegalArgumentException
would appear).key
- The String key object for which we need to obtain the param.
protected Object instantiateObjectByItem(com.sourceforge.jpatterns.schema.Item item, Class claz) throws JPConfigException
item
- the Item from value attribute of which we would instantiate the objectclaz
- the Class instance to check that implementation correlates with the interface for which we obtain this. Could be null.
JPConfigException
- in the case we can not instantiate the object using the value of the provided itemprotected Object instantiateObjectByItemAndType(com.sourceforge.jpatterns.schema.Item item, String type, Class claz) throws JPConfigException
item
- the Item from value attribute of which we would instantiate the object
Can not be null (otherwise IllegalArgumentException
would appear).type
- the type for which we need instantiate the object
Can not be null (otherwise IllegalArgumentException
would appear).claz
- this is necessary to perform the validation that the correct implementation is defined at the configuration file.
JPConfigException
- in the case we can not instantiate the object using the value of the provided itemprotected Map<String,String> getImplementationsNamesByItem(com.sourceforge.jpatterns.schema.Item item) throws JPConfigException
item
- the Item from value attribute of which we would instantiate the object
JPConfigException
- in the case we can not instantiate the object using the value of the provided itemprotected Map<String,Object> validateImplementationsMap(Class clazz, Map<String,Object> map)
clazz
- The class against which we would check the map, Can not be null (otherwise IllegalArgumentException
would appear).map
- containing the implementation we need to check
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |