Revision 44243 trunk/org.gvsig.desktop/org.gvsig.desktop.library/org.gvsig.expressionevaluator/org.gvsig.expressionevaluator.lib/org.gvsig.expressionevaluator.lib.impl/src/main/java/org/gvsig/expressionevaluator/impl/DefaultInterpreter.java
DefaultInterpreter.java | ||
---|---|---|
20 | 20 |
import org.gvsig.expressionevaluator.Function; |
21 | 21 |
import org.gvsig.expressionevaluator.impl.DefaultCodeBuilder.RecursionControlSupport; |
22 | 22 |
import org.gvsig.expressionevaluator.impl.function.operator.BinaryOperator; |
23 |
import org.gvsig.expressionevaluator.impl.function.programming.CallMethodFunction; |
|
24 | 23 |
import org.gvsig.expressionevaluator.impl.function.operator.UnaryOperator; |
25 | 24 |
import org.gvsig.expressionevaluator.impl.function.programming.ReturnFunction.ReturnException; |
26 | 25 |
|
... | ... | |
199 | 198 |
|
200 | 199 |
case Code.METHOD: { |
201 | 200 |
Method method = (Method) code; |
202 |
Function function = method.function(); |
|
203 |
if( function == null ) { |
|
204 |
Object obj = this.runCode(method.obj()); |
|
205 |
if( obj == null ) { |
|
206 |
throw new NullPointerException("An object pointer was expected to invoke method "+method.methodname()+" and a null was received"); |
|
201 |
Codes args = method.parameters(); |
|
202 |
int argc = (args == null) ? 0 : args.size(); |
|
203 |
Object[] argvalues = new Object[argc]; |
|
204 |
if( args != null ) { |
|
205 |
int i = 0; |
|
206 |
for( Code arg : args ) { |
|
207 |
argvalues[i++] = runCode(arg); |
|
207 | 208 |
} |
208 |
method.function(new CallMethodFunction(obj, method.methodname())); |
|
209 | 209 |
} |
210 |
value = method.call(this, argvalues); |
|
211 |
break; |
|
210 | 212 |
} |
211 | 213 |
case Code.CALLER: |
212 | 214 |
Caller caller = (Caller) code; |
Also available in: Unified diff