public class EvaluatorRegistry extends Object implements Externalizable
Constructor and Description |
---|
EvaluatorRegistry()
Default constructor.
|
EvaluatorRegistry(ClassLoader classloader)
Creates a new EvaluatorRegistry using the given classloader to load
the evaluator definition classes.
|
Modifier and Type | Method and Description |
---|---|
void |
addEvaluatorDefinition(EvaluatorDefinition def)
Adds an evaluator definition class to the registry.
|
void |
addEvaluatorDefinition(String className)
Adds an evaluator definition class to the registry using the
evaluator class name.
|
Evaluator |
getEvaluator(ValueType type,
Operator operator)
Returns the evaluator instance for the given type and the
defined parameterText
|
Evaluator |
getEvaluator(ValueType type,
Operator operator,
String parameterText)
Returns the evaluator instance for the given type and the
defined parameterText
|
Evaluator |
getEvaluator(ValueType type,
String operatorId,
boolean isNegated,
String parameterText)
Returns the evaluator instance for the given type and the
defined parameterText
|
EvaluatorDefinition |
getEvaluatorDefinition(Operator operator)
Returns the evaluator definition for the given operator
or null if no one was found
|
EvaluatorDefinition |
getEvaluatorDefinition(String evaluatorId)
Returns the evaluator definition for the given evaluator ID
or null if no one was found
|
Set<String> |
keySet()
Return the set of registered keys.
|
void |
readExternal(ObjectInput in) |
void |
writeExternal(ObjectOutput out) |
public EvaluatorRegistry()
public EvaluatorRegistry(ClassLoader classloader)
classloader
- the classloader to use to load evaluator definition
classes. If it is null, try to obtain the context
classloader. If it is also null, uses the same classloader
that loaded this class.public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
readExternal
in interface Externalizable
IOException
ClassNotFoundException
public void writeExternal(ObjectOutput out) throws IOException
writeExternal
in interface Externalizable
IOException
public void addEvaluatorDefinition(String className)
className
- the name of the class for the implementation definition.
The class must implement the EvaluatorDefinition interface.public void addEvaluatorDefinition(EvaluatorDefinition def)
def
- the evaluator definition to be added.public EvaluatorDefinition getEvaluatorDefinition(String evaluatorId)
evaluatorId
- public EvaluatorDefinition getEvaluatorDefinition(Operator operator)
operator
- the operator implemented by the evaluator definitionpublic Evaluator getEvaluator(ValueType type, String operatorId, boolean isNegated, String parameterText)
type
- the type of the attributes this evaluator will
operate on. This is important because the evaluator
may do optimizations and type coercion based on the
types it is evaluating. It is also possible that
this evaluator does not support a given type.operatorId
- the string identifier of the evaluatorisNegated
- true if the evaluator instance to be returned is
the negated version of the evaluator.parameterText
- some evaluators support parameters and these
parameters are defined as a String that is
parsed by the evaluator itself.public Evaluator getEvaluator(ValueType type, Operator operator, String parameterText)
type
- the type of the attributes this evaluator will
operate on. This is important because the evaluator
may do optimizations and type coercion based on the
types it is evaluating. It is also possible that
this evaluator does not support a given type.operator
- the operator that evaluator implementsparameterText
- some evaluators support parameters and these
parameters are defined as a String that is
parsed by the evaluator itself.public Evaluator getEvaluator(ValueType type, Operator operator)
type
- the type of the attributes this evaluator will
operate on. This is important because the evaluator
may do optimizations and type coercion based on the
types it is evaluating. It is also possible that
this evaluator does not support a given type.operator
- the operator that evaluator implementsCopyright © 2001–2017 JBoss by Red Hat. All rights reserved.