|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object mondrian.util.ObjectFactory<ExpCompiler> mondrian.calc.ExpCompiler.Factory
public static final class ExpCompiler.Factory
The 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.
Nested Class Summary | |
---|---|
static class |
ExpCompiler.Factory.Context
The ExpCompiler only has two override mechanisms: the
ThreadLocal and System
Properties . |
Nested classes/interfaces inherited from class mondrian.util.ObjectFactory |
---|
ObjectFactory.Singleton<T> |
Method Summary | |
---|---|
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 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. |
Methods inherited from class mondrian.util.ObjectFactory |
---|
defaultCreationException, getClassName, getObject, getObject, getObject, getObject, getObject |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static ExpCompiler getExpCompiler(Evaluator evaluator, Validator validator) throws CreationException
ExpCompiler
instance, each call returns a
new compiler.
CreationException
- if the compiler can not be createdevaluator
- the Evaluator
to use with the compilervalidator
- the Validator
to use with the compiler
ExpCompiler
compilerpublic static ExpCompiler getExpCompiler(Evaluator evaluator, Validator validator, List<ResultStyle> resultStyles) throws CreationException
CreationException
- if the compiler can not be createdevaluator
- the Evaluator
to use with the compilervalidator
- the Validator
to use with the compilerresultStyles
- the initial ResultStyle
array
for the compiler
ExpCompiler
compilerpublic 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 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>
CreationException
- if the ExpCompiler
can not be
created.parameterTypes
- array of classes: Evaluator, Validator and
ResultStyleparameterValues
- the Evaluator, Validator and ResultStyle
values
ExpCompiler
instancepublic 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.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |