ResourceELEvaluator implements IExpressionEvaluator { protected ResourceExpression getExpressionNamespace(ResourceExpression expr) { while(expr != null) { if (expr.m_type == ResourceExpressionType.NAMESPACE) { return expr; } expr = expr.getParent(); } return null; }  @Override Object evaluate(ResourceExpression expr); @Override Object evaluate(ResourceExpression expr, String property); @Override String evaluateAsString(ResourceExpression expr); @Override Set<Entry<String, Object>> evaluationAsEntrySet(ResourceExpression expr); @Override Set<String> evaluationAsKeySet(ResourceExpression expr);  }
@Test public void testGetExpressionNamespace() { ResourceELEvaluator evaluator = new ResourceELEvaluator(); ResourceExpression exp = new ResBeanExpression(); exp = (ResourceExpression)exp.get("js"); exp = (ResourceExpression)exp.get("local"); exp = (ResourceExpression)exp.get("static"); exp = (ResourceExpression)exp.get("EN"); exp = (ResourceExpression)exp.get("foo_js"); Assert.assertEquals("local",evaluator.getExpressionNamespace(exp).getKey()); }