use of org.mule.mvel2.compiler.CompiledAccExpression in project mule by mulesoft.
the class AbstractVariableEnricherDataTypePropagator method doPropagate.
@Override
protected boolean doPropagate(PrivilegedEvent event, PrivilegedEvent.Builder builder, TypedValue typedValue, ASTNode node) {
if (isAssignmentNode(node)) {
CompiledAccExpression compiledAccExpression = getCompiledAccExpression(node);
if (compiledAccExpression.getAccessor() instanceof VariableAccessor) {
VariableAccessor variableAccessor = (VariableAccessor) compiledAccExpression.getAccessor();
if (variableAccessor.getProperty().equals(propertyName)) {
final AccessorNode nextNode = variableAccessor.getNextNode();
if (nextNode.getNextNode() == null) {
String propertyName = null;
if (nextNode instanceof MapAccessorNest) {
final MapAccessorNest mapAccesorNest = (MapAccessorNest) nextNode;
if (mapAccesorNest.getProperty().isLiteralOnly()) {
propertyName = (String) ((ExecutableLiteral) mapAccesorNest.getProperty()).getLiteral();
}
} else if (nextNode instanceof MapAccessor) {
propertyName = (String) ((MapAccessor) nextNode).getProperty();
}
if (propertyName != null && containsVariable(event, propertyName)) {
propertyName = getUnescapedPropertyName(propertyName);
addVariable(event, builder, typedValue, propertyName);
return true;
}
}
}
}
}
return false;
}
Aggregations