Revision 43987 trunk/org.gvsig.desktop/org.gvsig.desktop.compat.cdc/org.gvsig.fmap.dal/org.gvsig.fmap.dal.impl/src/main/java/org/gvsig/fmap/dal/impl/expressionevaluator/DefaultExpressionEvaluator.java
DefaultExpressionEvaluator.java | ||
---|---|---|
95 | 95 |
); |
96 | 96 |
} |
97 | 97 |
|
98 |
private void compile() { |
|
99 |
this.code = this.compiler.compileExpression(expression.getPhrase()); |
|
100 |
} |
|
101 |
|
|
102 | 98 |
@Override |
103 | 99 |
public Object evaluate(EvaluatorData data) throws EvaluatorException { |
104 | 100 |
if (this.code == null) { |
... | ... | |
121 | 117 |
public EvaluatorFieldsInfo getFieldsInfo() { |
122 | 118 |
final Set<String> names = new HashSet<>(); |
123 | 119 |
try { |
124 |
this.code.accept(new Visitor() {
|
|
120 |
this.compile().accept(new Visitor() {
|
|
125 | 121 |
@Override |
126 | 122 |
public void visit(Object code) throws VisitCanceledException, BaseException { |
127 | 123 |
if (code instanceof Code.Identifier) { |
... | ... | |
181 | 177 |
return interpreter; |
182 | 178 |
} |
183 | 179 |
|
180 |
private Compiler getCompiler() { |
|
181 |
if (this.compiler == null) { |
|
182 |
ExpressionEvaluatorManager manager = ExpressionEvaluatorLocator.getManager(); |
|
183 |
this.compiler = manager.createCompiler(); |
|
184 |
} |
|
185 |
return compiler; |
|
186 |
} |
|
187 |
|
|
188 |
private Code compile() { |
|
189 |
if (this.code == null) { |
|
190 |
ExpressionEvaluatorManager manager = ExpressionEvaluatorLocator.getManager(); |
|
191 |
this.code = this.getCompiler().compileExpression(expression.getPhrase()); |
|
192 |
} |
|
193 |
return code; |
|
194 |
} |
|
195 |
|
|
184 | 196 |
@Override |
185 | 197 |
public Evaluator clone() throws CloneNotSupportedException { |
186 | 198 |
DefaultExpressionEvaluator other = (DefaultExpressionEvaluator) super.clone(); |
Also available in: Unified diff