blob: 2e0ec456df2be76742cf96a595d40462362d8bbf (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
|
package org.eclipse.cdt.internal.corext.template;
/*
* (c) Copyright IBM Corp. 2000, 2001.
* All Rights Reserved.
*/
/**
* A simple template variable, which always evaluates to a defined string.
*/
public class SimpleTemplateVariable extends TemplateVariable {
/** The string to which this variable evaluates. */
private String fEvaluationString;
/** A flag indicating if this variable can be resolved. */
private boolean fResolved;
/*
* @see TemplateVariable#TemplateVariable(String, String)
*/
protected SimpleTemplateVariable(String name, String description) {
super(name, description);
}
/**
* Sets the string to which this variable evaluates.
*
* @param evaluationString the evaluation string, may be <code>null</code>.
*/
public final void setEvaluationString(String evaluationString) {
fEvaluationString= evaluationString;
}
/*
* @see TemplateVariable#evaluate(TemplateContext)
*/
public String evaluate(TemplateContext context) {
return fEvaluationString;
}
/**
* Sets the resolved flag.
*/
public final void setResolved(boolean resolved) {
fResolved= resolved;
}
/*
* @see TemplateVariable#isResolved(TemplateContext)
*/
public boolean isResolved(TemplateContext context) {
return fResolved;
}
}
|