/** * A factory method to create a new child context of the * current context. */ public JellyContext newJellyContext(Map newVariables) { // XXXX: should allow this new context to // XXXX: inherit parent contexts? // XXXX: Or at least publish the parent scope // XXXX: as a Map in this new variable scope? newVariables.put("parentScope", variables); JellyContext answer = createChildContext(); answer.setVariables(newVariables); return answer; }
public Object evaluate(JellyContext context) { context = new CustomJellyContext(context); context.setVariables(resourceLiterals); return innerExpression.evaluate(context); } }
public Object evaluate(JellyContext context) { context = new CustomJellyContext(context); context.setVariables(resourceLiterals); return innerExpression.evaluate(context); } }
/** * A factory method to create a new child context of the * current context. */ public JellyContext newJellyContext(Map newVariables) { // XXXX: should allow this new context to // XXXX: inherit parent contexts? // XXXX: Or at least publish the parent scope // XXXX: as a Map in this new variable scope? JellyContext answer = createChildContext(); answer.setVariables(newVariables); answer.setVariable("parentScope", variables); return answer; }
/** * A factory method to create a new child context of the * current context. */ public JellyContext newJellyContext(Map newVariables) { // XXXX: should allow this new context to // XXXX: inherit parent contexts? // XXXX: Or at least publish the parent scope // XXXX: as a Map in this new variable scope? JellyContext answer = createChildContext(); answer.setVariables(newVariables); answer.setVariable("parentScope", variables); return answer; }
/** * A factory method to create a new child context of the * current context. */ public JellyContext newJellyContext(Map newVariables) { // XXXX: should allow this new context to // XXXX: inherit parent contexts? // XXXX: Or at least publish the parent scope // XXXX: as a Map in this new variable scope? JellyContext answer = createChildContext(); answer.setVariables(newVariables); answer.setVariable("parentScope", variables); return answer; }
public void testSetVariablesAndRetainContextEntry() { final JellyContext jc = new JellyContext(); assertNotNull( "Initial variable of context", jc.getVariable( "context" ) ); jc.setVariables( new HashMap() ); assertNotNull( "Value after setVariables()", jc.getVariable( "context" ) ); } }