Package org.openl
Class OpenL
- java.lang.Object
-
- org.openl.OpenL
-
public class OpenL extends Object
This class describes OpenL engine context abstraction that used during compilation process.The class OpenL implements both factory(static) methods for creating OpenL instances and actual OpenL functionality. Each instance of OpenL should be considered as a Language Configuration(LC). You may have as many LCs in your application as you want. Current OpenL architecture allows to have different OpenL configurations in separate class loaders, so they will not interfere with each other. It allows, for example, to have 2 LCs using different SAX or DOM parser implementation.
The actual work is done by class OpenLConfigurator.
- Author:
- snshor
- See Also:
OpenLConfigurator
-
-
Field Summary
Fields Modifier and Type Field Description static String
OPENL_J_NAME
static String
OPENL_JAVA_NAME
static String
OPENL_JAVA_RULE_NAME
-
Constructor Summary
Constructors Constructor Description OpenL()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description IOpenBinder
getBinder()
Gets binder that configured for current OpenL instance.static OpenL
getInstance(String name)
Gets instance ofOpenL
with given name.static OpenL
getInstance(String name, IUserContext userContext)
Gets an instance of OpenL.static OpenL
getInstance(String name, IUserContext userContext, IOpenLBuilder builder)
Gets an instance of OpenL.String
getName()
Gets name of OpenL instance.IOpenParser
getParser()
Gets parser that configured for current OpenL instance.IOpenVM
getVm()
Gets virtual machine which used during rules execution.void
setBinder(IOpenBinder binder)
Sets binder to current OpenL instance.static void
setConfig(OpenLConfigurator config)
Change default OpenLConfigurator implementation to another.void
setName(String name)
Sets name of OpenL instance.void
setParser(IOpenParser parser)
Sets parser to current OpenL instance.void
setVm(IOpenVM openVM)
Sets virtual machine.String
toString()
-
-
-
Field Detail
-
OPENL_J_NAME
public static final String OPENL_J_NAME
- See Also:
- Constant Field Values
-
OPENL_JAVA_NAME
public static final String OPENL_JAVA_NAME
- See Also:
- Constant Field Values
-
OPENL_JAVA_RULE_NAME
public static final String OPENL_JAVA_RULE_NAME
- See Also:
- Constant Field Values
-
-
Method Detail
-
setConfig
public static void setConfig(OpenLConfigurator config)
Change default OpenLConfigurator implementation to another.- Parameters:
config
- new OpenLConfigurator
-
getInstance
public static OpenL getInstance(String name)
Gets instance ofOpenL
with given name.- Parameters:
name
- OpenL name- Returns:
- instance of OpenL
- Throws:
OpenLConfigurationException
-
getInstance
public static OpenL getInstance(String name, IUserContext userContext)
Gets an instance of OpenL. Each instance is cached with name and user context as it's key. To remove cached instance use #remove method- Parameters:
name
- IOpenL name, for example org.openl.java12.v101userContext
- user context- Returns:
- instance of IOpenL
- Throws:
OpenLConfigurationException
- See Also:
#remove
,IUserContext
-
getInstance
public static OpenL getInstance(String name, IUserContext userContext, IOpenLBuilder builder)
Gets an instance of OpenL. Each instance is cached with name and user context as it's key.- Parameters:
name
- IOpenL nameuserContext
- user contextbuilder
-IOpenLBuilder
instance which used to build new instance of OpenL if that does not exist- Returns:
- instance of IOpenL
- Throws:
OpenLConfigurationException
- See Also:
IUserContext
-
getName
public String getName()
Gets name of OpenL instance.- Returns:
- name string
-
setName
public void setName(String name)
Sets name of OpenL instance.- Parameters:
name
- name string
-
getParser
public IOpenParser getParser()
Gets parser that configured for current OpenL instance.- Returns:
IOpenParser
instance
-
setParser
public void setParser(IOpenParser parser)
Sets parser to current OpenL instance.- Parameters:
parser
-IOpenParser
instance
-
getVm
public IOpenVM getVm()
Gets virtual machine which used during rules execution.- Returns:
IOpenVM
instance
-
setVm
public void setVm(IOpenVM openVM)
Sets virtual machine.- Parameters:
openVM
-IOpenVM
instance
-
getBinder
public IOpenBinder getBinder()
Gets binder that configured for current OpenL instance.- Returns:
IOpenBinder
instance
-
setBinder
public void setBinder(IOpenBinder binder)
Sets binder to current OpenL instance.- Parameters:
binder
-IOpenBinder
instance
-
-