01: package org.wings.macro;
02:
03: import java.util.Collection;
04: import java.util.ArrayList;
05:
06: /**
07: * <code>DefaultMacro<code>.
08: * <p/>
09: * User: rrd
10: * Date: 13.08.2007
11: * Time: 11:08:07
12: *
13: * @author rrd
14: * @version $Id
15: */
16: public class MacroContainer implements Macro {
17:
18: private MacroContext context;
19:
20: private Collection<Instruction> instructions = new ArrayList<Instruction>();
21:
22: public void setContext(MacroContext context) {
23: this .context = context;
24: }
25:
26: /**
27: * {@inheritDoc}
28: */
29: public void addInstruction(Instruction instruction) {
30: instructions.add(instruction);
31: }
32:
33: /**
34: * {@inheritDoc}
35: */
36: public void execute() {
37: for (Instruction instruction : instructions) {
38: instruction.execute(context);
39: }
40: }
41: }
|