Object value = this.context.getVariableContext().getGlobalValue(this.prepPlan.getReferences().get(i).getContextSymbol()); multiValue.add(value); Constant c = new Constant(null, this.prepPlan.getReferences().get(i).getType()); c.setMultiValued(multiValues.get(i)); this.context.getVariableContext().setGlobalValue(this.prepPlan.getReferences().get(i).getContextSymbol(), c);
public static void setParameterValues(List<?> values, Command command, CommandContext context) { VariableContext vc = new VariableContext(); Iterator<?> valIter = values.iterator(); for (Reference ref : ReferenceCollectorVisitor.getReferences(command)) { if (!ref.isPositional()) { continue; } vc.setGlobalValue(ref.getContextSymbol(), valIter.next()); //$NON-NLS-1$ } context.setVariableContext(vc); }
Object value = this.context.getVariableContext().getGlobalValue(this.prepPlan.getReferences().get(i).getContextSymbol()); multiValue.add(value); Constant c = new Constant(null, this.prepPlan.getReferences().get(i).getType()); c.setMultiValued(multiValues.get(i)); this.context.getVariableContext().setGlobalValue(this.prepPlan.getReferences().get(i).getContextSymbol(), c);
Object value = this.context.getVariableContext().getGlobalValue(this.prepPlan.getReferences().get(i).getContextSymbol()); multiValue.add(value); Constant c = new Constant(null, this.prepPlan.getReferences().get(i).getType()); c.setMultiValued(multiValues.get(i)); this.context.getVariableContext().setGlobalValue(this.prepPlan.getReferences().get(i).getContextSymbol(), c);
result.setGlobalValue(param.getContextSymbol(), value);
result.setGlobalValue(param.getContextSymbol(), value);
result.setGlobalValue(param.getContextSymbol(), value);
Reference ref = (Reference)expression; if (ref.isPositional() && ref.getExpression() == null) { return getContext(ref).getVariableContext().getGlobalValue(ref.getContextSymbol());
Reference ref = (Reference)expression; if (ref.isPositional() && ref.getExpression() == null) { return getContext(ref).getVariableContext().getGlobalValue(ref.getContextSymbol());
Reference ref = (Reference)expression; if (ref.isPositional() && ref.getExpression() == null) { return getContext(ref).getVariableContext().getGlobalValue(ref.getContextSymbol());
@Test public void testEvaluatedSetCriteria() throws Exception { DependentAccessNode dan = new DependentAccessNode(0); CommandContext cc = new CommandContext(); dan.setContext(cc); List<Reference> references = Arrays.asList(new Reference(1), new Reference(2)); for (Reference reference : references) { cc.getVariableContext().setGlobalValue(reference.getContextSymbol(), 1); } SetCriteria sc = new SetCriteria(new ElementSymbol("e1"), references); //$NON-NLS-1$ sc.setAllConstants(true); DependentCriteriaProcessor dcp = new DependentCriteriaProcessor(1, -1, dan, sc); Criteria result = dcp.prepareCriteria(); assertEquals(new CompareCriteria(new ElementSymbol("e1"), CompareCriteria.EQ, new Constant(1)), result); //$NON-NLS-1$ assertFalse(dcp.hasNextCommand()); }