62b4a7a6c1c41d47e32eed0e1f604788523bc554
[phpeclipse.git] /
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 simple template variable, which always evaluates to a defined string.
9  */
10 public class SimpleTemplateVariable extends TemplateVariable {
11
12         /** The string to which this variable evaluates. */
13         private String fEvaluationString;
14         /** A flag indicating if this variable can be resolved. */
15         private boolean fResolved;
16
17         /*
18          * @see TemplateVariable#TemplateVariable(String, String)
19          */
20         protected SimpleTemplateVariable(String name, String description) {
21                 super(name, description);
22         }
23
24         /**
25          * Sets the string to which this variable evaluates.
26          * 
27          * @param evaluationString the evaluation string, may be <code>null</code>.
28          */
29         public final void setEvaluationString(String evaluationString) {
30                 fEvaluationString= evaluationString;    
31         }
32
33         /*
34          * @see TemplateVariable#evaluate(TemplateContext)
35          */
36         public String evaluate(TemplateContext context) {
37                 return fEvaluationString;
38         }
39
40         /**
41          * Sets the resolved flag.
42          */
43         public final void setResolved(boolean resolved) {
44                 fResolved= resolved;
45         }
46
47         /*
48          * @see TemplateVariable#isResolved(TemplateContext)
49          */
50         public boolean isResolved(TemplateContext context) {
51                 return fResolved;
52         }
53
54 }