Coverage Report

##### Coverage Report - org.webmacro.engine.FunctionVariable

Classes in this File | Line Coverage | Branch Coverage | Complexity
FunctionVariable |
0% | 0/7
N/A | N/A
| 1.2;1.2

1 |  |
     /*
2 |  |
      * FunctionVariable.java
3 |  |
      *
4 |  |
      * Created on March 21, 2003, 12:15 AM
5 |  |
      */
6 |  |
7 |  |
     package org.webmacro.engine;
8 |  |
9 |  |
     import org.webmacro.Context;
10 |  |
     import org.webmacro.PropertyException;
11 |  |
12 |  |
     /**
13 |  |
      *
14 |  |
      * @author  Keats
15 |  |
      */
16 |  |
     public class FunctionVariable extends Variable
17 |  |
     {
18 | 0 |
         final public static Object TYPE = new Object();
19 |  |
20 |  |
         /** Creates a new instance of FunctionVariable */
21 |  |
         public FunctionVariable (Object names[])
22 |  |
         {
23 | 0 |
             super(names);
24 | 0 |
         }
25 |  |
26 |  |
         /** The code to get the value represented by the variable from the
27 |  |
          * supplied context.
28 |  |
          *
29 |  |
          */
30 |  |
         public Object getValue (Context context) throws PropertyException
31 |  |
         {
32 | 0 |
            return context.getProperty(_names);
33 |  |
            //return context.getProperty(_names[0]);
34 |  |
         }
35 |  |
36 |  |
         /** The code to set the value represented by the variable in the
37 |  |
          * supplied context.
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 |  |
          * Return the String name of the variable prefixed with a string
47 |  |
          * representing its type, in this case "function:".
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 |  |
     }