use of org.drools.mvelcompiler.util.TypeUtils.classFromType in project drools by kiegroup.
the class RHSPhase method asFieldAccessTExpr.
private Optional<TypedExpression> asFieldAccessTExpr(SimpleName n, Context arg) {
Optional<TypedExpression> lastTypedExpression = arg.scope;
Optional<Type> scopeType = arg.getScopeType();
Optional<Field> fieldType = scopeType.flatMap(te -> {
Class parentClass = TypeUtils.classFromType(te);
Field field = ClassUtils.getField(parentClass, n.asString());
return ofNullable(field);
});
return map2(lastTypedExpression, fieldType, FieldAccessTExpr::new);
}
Aggregations