Map<ElementSelector, Action> ruleMap = new HashMap<ElementSelector, Action>();
// Note the wild card character '*', in the paterns, signifying any level
// of nesting.
ruleMap.put(new ElementSelector("*/computation"), new ComputationAction2());
ruleMap.put(new ElementSelector("*/computation/literal"), new LiteralAction());
ruleMap.put(new ElementSelector("*/computation/add"), new AddAction());
ruleMap.put(new ElementSelector("*/computation/multiply"), new MultiplyAction());
Context context = new ContextBase();
SimpleConfigurator simpleConfigurator = new SimpleConfigurator(ruleMap);
// link the configurator with its context
simpleConfigurator.setContext(context);