1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20 package org.peaseplate.internal.lang.command;
21
22 import org.peaseplate.TemplateRuntimeException;
23 import org.peaseplate.internal.BuildContext;
24 import org.peaseplate.locator.TemplateLocator;
25
26 public abstract class AbstractDoubleParameterCommand extends AbstractCommand {
27
28 private final ICommand leftCommand;
29 private final ICommand rightCommand;
30
31 public AbstractDoubleParameterCommand(TemplateLocator locator, int line, int column, ICommand leftCommand, ICommand rightCommand) {
32 super(locator, line, column);
33
34 this.leftCommand = leftCommand;
35 this.rightCommand = rightCommand;
36 }
37
38 public ICommand getLeftCommand() {
39 return leftCommand;
40 }
41
42 public ICommand getRightCommand() {
43 return rightCommand;
44 }
45
46 public Object callLeftCommand(BuildContext context) throws TemplateRuntimeException {
47 return getLeftCommand().call(context);
48 }
49
50 public Object callRightCommand(BuildContext context) throws TemplateRuntimeException {
51 return getRightCommand().call(context);
52 }
53
54 }