1 | |
|
2 | |
|
3 | |
|
4 | |
|
5 | |
|
6 | |
|
7 | |
package org.webmacro.engine; |
8 | |
|
9 | |
import org.webmacro.Context; |
10 | |
import org.webmacro.PropertyException; |
11 | |
|
12 | |
|
13 | |
|
14 | |
|
15 | |
|
16 | |
public class FunctionVariable extends Variable |
17 | |
{ |
18 | 0 | final public static Object TYPE = new Object(); |
19 | |
|
20 | |
|
21 | |
public FunctionVariable (Object names[]) |
22 | |
{ |
23 | 0 | super(names); |
24 | 0 | } |
25 | |
|
26 | |
|
27 | |
|
28 | |
|
29 | |
|
30 | |
public Object getValue (Context context) throws PropertyException |
31 | |
{ |
32 | 0 | return context.getProperty(_names); |
33 | |
|
34 | |
} |
35 | |
|
36 | |
|
37 | |
|
38 | |
|
39 | |
|
40 | |
public void setValue (Context c, Object v) throws PropertyException |
41 | |
{ |
42 | 0 | throw new PropertyException("Cannot set the value of a function: " + getVariableName()); |
43 | |
} |
44 | |
|
45 | |
|
46 | |
|
47 | |
|
48 | |
|
49 | |
public String toString () |
50 | |
{ |
51 | 0 | return "function:" + getVariableName(); |
52 | |
} |
53 | |
|
54 | |
public boolean isSimpleName () |
55 | |
{ |
56 | 0 | return false; |
57 | |
} |
58 | |
|
59 | |
} |