|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface IJPFactory
The factory pattern implementation (in the terms of the JPatterns concept). Please be noticed the real implementation of this interface
is specified at the JPatterns config properties file. When we have the factory pattern working then we would be able to save other
implementationsw at the factory. Be noticed that there would be mapping
castor type base name <-> implementation of the JPatterns interface we would need for working with the concrete castor type.
All the methods of this interface have "scope" argument. It is optional. If this is null we use the scope of the appropriate
Factory object to obtain the scope of the implementation. if it is not null - we are using it as the scope id - please review
comments to IJPEngine.getFactory(String,String)
for more on that.
todo [zmicer]: provide XML based examples of the configurations for the each method. Document the pattern.
Method Summary | |
---|---|
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. |
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. |
Methods inherited from interface com.sourceforge.jpatterns.patterns.IJPattern |
---|
checkCastorConfig, init |
Methods inherited from interface com.zmicer.utils.model.ICheckable |
---|
check |
Method Detail |
---|
Object getImplementation(Class interfaceClass, String scope) throws JPConfigException
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)
JPConfigException
- in the case we can not retrieve the implementation for some reasonsObject getImplementation(String interfaceClassBaseName, String scope) throws JPConfigException
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)
JPConfigException
- in the case we can not retrieve the implementation for some reasonsString getImplementationFullName(Class interfaceClass, String scope) throws JPConfigException
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)
JPConfigException
- in the case we can not retrieve the implementation for some reasonsString getImplementationFullName(String interfaceClassBaseName, String scope) throws JPConfigException
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)
JPConfigException
- in the case we can not retrieve the implementation for some reasonsObject getImplementation(Class interfaceClass, String implType, String scope) throws JPConfigException
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)
JPConfigException
- in the case we can not retrieve the implementation for some reasonsObject getImplementation(String interfaceClassBaseName, String implType, String scope) throws JPConfigException
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)
JPConfigException
- in the case we can not retrieve the implementation for some reasonsMap<String,Object> getImplementations(Class interfaceClass, String scope) throws JPConfigException
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)
JPConfigException
- in the case we can not retrieve the implementation for some reasonsMap<String,Object> getImplementations(String interfaceClassBaseName, String scope) throws JPConfigException
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)
JPConfigException
- in the case we can not retrieve the implementation for some reasonsMap<String,String> getImplementationsFullNames(Class interfaceClass, String scope) throws JPConfigException
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)
JPConfigException
- in the case we can not retrieve the implementation for some reasonsMap<String,String> getImplementationsFullNames(String interfaceClassBaseName, String scope) throws JPConfigException
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)
JPConfigException
- in the case we can not retrieve the implementation for some reasonsObject getOperator(Class productBaseClass, Class operatorBaseClass, Object productObj, String scope) throws JPConfigException
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)
JPConfigException
- in the case we can not retrieve the implementation for some reasonsMap<Object,Object> getOperators(Class productBaseClass, Class operatorBaseClass, List<Object> productObjs, String scope) throws JPConfigException
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.
JPConfigException
- in the case we can not retrieve the implementation for some reasons
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |