Class AbstractExpressionEvaluator<V extends PrismValue,D extends ItemDefinition,E>
- java.lang.Object
-
- com.evolveum.midpoint.repo.common.expression.evaluator.AbstractExpressionEvaluator<V,D,E>
-
- Type Parameters:
E
- evaluator bean (configuration) type
- All Implemented Interfaces:
ExpressionEvaluator<V>
- Direct Known Subclasses:
AbstractValueTransformationExpressionEvaluator
,AsIsExpressionEvaluator
,AssociationFromLinkExpressionEvaluator
,ConstExpressionEvaluator
,FunctionExpressionEvaluator
,GenerateExpressionEvaluator
,LiteralExpressionEvaluator
,PathExpressionEvaluator
,ProportionalExpressionEvaluator
,SequentialValueExpressionEvaluator
public abstract class AbstractExpressionEvaluator<V extends PrismValue,D extends ItemDefinition,E> extends Object implements ExpressionEvaluator<V>
- Author:
- Radovan Semancik
-
-
Field Summary
Fields Modifier and Type Field Description protected E
expressionEvaluatorBean
Bean (i.e.protected D
outputDefinition
Definition of the output item.protected @NotNull PrismContext
prismContext
protected Protector
protector
-
Constructor Summary
Constructors Constructor Description AbstractExpressionEvaluator(@NotNull QName elementName, E expressionEvaluatorBean, D outputDefinition, Protector protector, @NotNull PrismContext prismContext)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addInternalOrigin(PrismValue value, ExpressionEvaluationContext context)
Adds Internal origin for given prismValue.void
applyValueMetadata(PrismValueDeltaSetTriple<V> triple, ExpressionEvaluationContext context, OperationResult result)
Applies value metadata to the triple to-be-outputted.protected void
checkEvaluatorProfile(ExpressionEvaluationContext context)
Check expression profile.TypedValue<?>
findInSourcesAndVariables(ExpressionEvaluationContext context, String variableName)
PrismValueDeltaSetTriple<V>
finishOutputTriple(PrismValueDeltaSetTriple<V> resultTriple, Function<Object,Object> additionalConvertor, ItemPath residualPath)
Converts intermediate expression result triple to the final output triple according to expected Java type and additional convertor.@NotNull QName
getElementName()
Fully qualified name of the element defining the expression (e.g.D
getOutputDefinition()
@NotNull PrismContext
getPrismContext()
Protector
getProtector()
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.evolveum.midpoint.repo.common.expression.ExpressionEvaluator
evaluate, shortDebugDump
-
-
-
-
Field Detail
-
expressionEvaluatorBean
protected final E expressionEvaluatorBean
Bean (i.e. configuration) for the evaluator. In some cases it can be null - e.g. for implicit asIs evaluator.
-
outputDefinition
protected final D extends ItemDefinition outputDefinition
Definition of the output item. Needed for some of the evaluators (the question is if it's really needed).
-
protector
protected final Protector protector
-
prismContext
@NotNull protected final @NotNull PrismContext prismContext
-
-
Constructor Detail
-
AbstractExpressionEvaluator
public AbstractExpressionEvaluator(@NotNull @NotNull QName elementName, E expressionEvaluatorBean, D outputDefinition, Protector protector, @NotNull @NotNull PrismContext prismContext)
-
-
Method Detail
-
getElementName
@NotNull public @NotNull QName getElementName()
Description copied from interface:ExpressionEvaluator
Fully qualified name of the element defining the expression (e.g. c:path).- Specified by:
getElementName
in interfaceExpressionEvaluator<V extends PrismValue>
-
checkEvaluatorProfile
protected void checkEvaluatorProfile(ExpressionEvaluationContext context) throws SecurityViolationException
Check expression profile. Throws security exception if the execution is not allowed by the profile.This implementation works only for simple evaluators that do not have any profile settings. Complex evaluators should override this method.
- Throws:
SecurityViolationException
- expression execution is not allowed by the profile.
-
getPrismContext
@NotNull public @NotNull PrismContext getPrismContext()
-
getOutputDefinition
public D getOutputDefinition()
-
getProtector
public Protector getProtector()
-
finishOutputTriple
public PrismValueDeltaSetTriple<V> finishOutputTriple(PrismValueDeltaSetTriple<V> resultTriple, Function<Object,Object> additionalConvertor, ItemPath residualPath)
Converts intermediate expression result triple to the final output triple according to expected Java type and additional convertor. TODO why it is used only for some evaluators?
-
findInSourcesAndVariables
public TypedValue<?> findInSourcesAndVariables(ExpressionEvaluationContext context, String variableName)
-
addInternalOrigin
public void addInternalOrigin(PrismValue value, ExpressionEvaluationContext context) throws SchemaException
Adds Internal origin for given prismValue. Assumes that value has no metadata. (Currently does not fill-in actorRef nor channel.)- Throws:
SchemaException
-
applyValueMetadata
public void applyValueMetadata(PrismValueDeltaSetTriple<V> triple, ExpressionEvaluationContext context, OperationResult result) throws CommunicationException, ObjectNotFoundException, SchemaException, SecurityViolationException, ConfigurationException, ExpressionEvaluationException
Applies value metadata to the triple to-be-outputted. To be used for simple mappings that basically copy data from given source (input IDI or some other data source) to the output.
-
-