Revision 44389 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/DefaultCodeBuilder.java
DefaultCodeBuilder.java | ||
---|---|---|
4 | 4 |
import java.util.Collections; |
5 | 5 |
import java.util.Iterator; |
6 | 6 |
import java.util.List; |
7 |
import org.apache.commons.lang3.ObjectUtils; |
|
7 | 8 |
import org.apache.commons.lang3.StringUtils; |
8 | 9 |
import org.gvsig.expressionevaluator.Code; |
9 | 10 |
import static org.gvsig.expressionevaluator.Code.CALLER; |
... | ... | |
50 | 51 |
import org.gvsig.expressionevaluator.impl.function.programming.GetattrFunction; |
51 | 52 |
import org.gvsig.expressionevaluator.impl.function.programming.GetitemFunction; |
52 | 53 |
import org.gvsig.fmap.geom.Geometry; |
54 |
import org.gvsig.tools.dynobject.DynObject; |
|
55 |
import org.gvsig.tools.dynobject.exception.DynMethodNotSupportedException; |
|
53 | 56 |
import org.gvsig.tools.exception.BaseException; |
57 |
import org.gvsig.tools.script.Script; |
|
54 | 58 |
import org.gvsig.tools.visitor.Visitor; |
55 | 59 |
|
56 | 60 |
@SuppressWarnings("UseSpecificCatch") |
... | ... | |
557 | 561 |
@Override |
558 | 562 |
public Object call(Interpreter interpreter, Object[] args) throws Exception { |
559 | 563 |
Object theInstance = interpreter.run(instance); |
564 |
if( theInstance instanceof SimpleScript ) { |
|
565 |
try { |
|
566 |
return ((SimpleScript)theInstance).invokeFunction(methodname, args); |
|
567 |
} catch(NoSuchMethodException ex) { |
|
568 |
// Ignore... continue calling instance method |
|
569 |
} |
|
570 |
} else if( theInstance instanceof DynObject ) { |
|
571 |
DynObject dynobj = (DynObject) theInstance; |
|
572 |
try { |
|
573 |
return dynobj.invokeDynMethod(methodname, args); |
|
574 |
} catch(DynMethodNotSupportedException ex) { |
|
575 |
// Ignore... continue calling instance method |
|
576 |
} |
|
577 |
} |
|
560 | 578 |
return InstanceUtils.callmethod(theInstance, methodname, args); |
561 | 579 |
} |
562 | 580 |
|
Also available in: Unified diff