public static final class ExpCompiler.Factory extends ObjectFactory<ExpCompiler>
ExpCompiler.Factory is used to access
ExpCompiler implementations. Each call returns
a new instance. This factory supports overriding the default
instance by use of a ThreadLocal and by defining a
System property with the ExpCompiler
class name.| Modifier and Type | Class and Description |
|---|---|
static class |
ExpCompiler.Factory.Context
The
ExpCompiler only has two override mechanisms: the
ThreadLocal and System
Properties. |
ObjectFactory.Singleton<T>| Modifier and Type | Method and Description |
|---|---|
static void |
clearThreadLocalClassName()
Clears the class name (regardless of whether a class name was set).
|
protected String |
getClassName()
Get the class name set in the
ThreadLocal or null. |
protected ExpCompiler |
getDefault(Class[] parameterTypes,
Object[] parameterValues)
The
ExpCompiler.Factory's implementation of the
ObjectFactory's abstract method which returns
the default ExpCompiler instance. |
static ExpCompiler |
getExpCompiler(Evaluator evaluator,
Validator validator)
Create a
ExpCompiler instance, each call returns a
new compiler. |
static ExpCompiler |
getExpCompiler(Evaluator evaluator,
Validator validator,
List<ResultStyle> resultStyles) |
static ExpCompiler.Factory |
getFactory()
Get the underlying Factory object.
|
protected org.eigenbase.util.property.StringProperty |
getStringProperty()
Return the ExpCompiler.Factory
|
static String |
getThreadLocalClassName()
Get the class name of a
ExpCompiler implementation
or null. |
Object |
removeContext()
Get the current override contect.
|
void |
restoreContext(Object context)
Restore the current overrides.
|
static void |
setThreadLocalClassName(String className)
Sets the class name of a
ExpCompiler implementation. |
getClassName, getObject, getObject, getObject, getObject, getObjectpublic static ExpCompiler getExpCompiler(Evaluator evaluator, Validator validator) throws CreationException
ExpCompiler instance, each call returns a
new compiler.evaluator - the Evaluator to use with the compilervalidator - the Validator to use with the compilerExpCompiler compilerCreationException - if the compiler can not be createdpublic static ExpCompiler getExpCompiler(Evaluator evaluator, Validator validator, List<ResultStyle> resultStyles) throws CreationException
evaluator - the Evaluator to use with the compilervalidator - the Validator to use with the compilerresultStyles - the initial ResultStyle array
for the compilerExpCompiler compilerCreationException - if the compiler can not be createdpublic static String getThreadLocalClassName()
ExpCompiler implementation
or null.public static void setThreadLocalClassName(String className)
ExpCompiler implementation.
This should be called (obviously) before calling the
ExpCompiler.Factory getExpCompiler
method to get the ExpCompiler implementation.
Generally, this is only used for testing.className - Class namepublic static void clearThreadLocalClassName()
setThreadLocalClassName,
the setting whould be done in a try-block and a call to this
clear method should be in the finally-clause of that try-block.protected String getClassName()
ThreadLocal or null.getClassName in class ObjectFactory<ExpCompiler>protected org.eigenbase.util.property.StringProperty getStringProperty()
ExpCompiler.Factory
getStringProperty in class ObjectFactory<ExpCompiler>ExpCompiler.Factory property nameprotected ExpCompiler getDefault(Class[] parameterTypes, Object[] parameterValues) throws CreationException
ExpCompiler.Factory's implementation of the
ObjectFactory's abstract method which returns
the default ExpCompiler instance.getDefault in class ObjectFactory<ExpCompiler>parameterTypes - array of classes: Evaluator, Validator and
ResultStyleparameterValues - the Evaluator, Validator and ResultStyle
valuesExpCompiler instanceCreationException - if the ExpCompiler can not be
created.public static ExpCompiler.Factory getFactory()
This is for testing only.
ExpCompiler.Factory objectpublic Object removeContext()
This is for testing only.
removeContext in class ObjectFactory<ExpCompiler>public void restoreContext(Object context)
This is for testing only.
restoreContext in class ObjectFactory<ExpCompiler>context - the current override object.Copyright © 2021 Hitachi Vantara. All rights reserved.