Map<String, Class< ? >> globals = context.getPackageBuilder().getGlobals();
final AnalysisResult analysis = context.getDialect().analyzeExpression( context,
descr,
fieldName,
new BoundIdentifiers( declarations,
globals,
null,
((ClassObjectType) objectType).getClassType() ) );
if ( analysis == null ) {
// something bad happened
if ( reportError ) {
context.addError(new DescrBuildError(context.getParentDescr(),
descr,
null,
"Unable to analyze expression '" + fieldName + "'"));
}
return null;
}
final BoundIdentifiers usedIdentifiers = analysis.getBoundIdentifiers();
if ( !usedIdentifiers.getDeclrClasses().isEmpty() ) {
if ( reportError && descr instanceof BindingDescr ) {
context.addError(new DescrBuildError(context.getParentDescr(),
descr,
null,
"Variables can not be used inside bindings. Variable " + usedIdentifiers.getDeclrClasses().keySet() + " is being used in binding '" + fieldName + "'"));
}
return null;
}
reader = context.getPkg().getClassFieldAccessorStore().getMVELReader( context.getPkg().getName(),