Fixed ?
[phpeclipse.git] / net.sourceforge.phpeclipse / src / net / sourceforge / phpdt / internal / corext / template / TemplateVariable.java
1 /*
2  * (c) Copyright IBM Corp. 2000, 2001.
3  * All Rights Reserved.
4  */
5 package net.sourceforge.phpdt.internal.corext.template;
6
7 /**
8  * A template variable.
9  */
10 public abstract class TemplateVariable {
11
12         /** name of the variable */
13         private final String fName;
14
15         /** description of the variable */
16         private final String fDescription;
17         
18         /**
19          * Creates an instance of <code>TemplateVariable</code>.
20          * 
21          * @param name the name of the variable
22          * @param description the description for the variable
23          */
24         protected TemplateVariable(String name, String description) {
25                 fName= name;
26                 fDescription= description;   
27         }
28         
29         /**
30          * Returns the name of the variable.
31          */
32         public String getName() {
33                 return fName;
34         }
35
36         /**
37          * Returns the description for the variable.
38          */
39         public String getDescription() {
40                 return fDescription;   
41         }
42
43         /**
44          * Tests if this variable can be evaluated.
45          */
46 //      public abstract boolean canEvaluate(TemplateContext context);
47         
48         /**
49          * Evaluates this variable
50          * 
51          * @return the evaluated string, or <code>null</code> if not evaluatable.
52          */
53         public abstract String evaluate(TemplateContext context);
54
55         /**
56          * Returns whether this variable is resolved.
57          * By default, the variable is not resolved.
58          * Clients can overwrite this method to force resolution of the variable.
59          */
60         public boolean isResolved(TemplateContext context) {
61                 return false;
62         }
63
64 }