public class MethodCall extends Expression
| 构造器和说明 |
|---|
MethodCall(Span span,
MemberAccess method,
List<Expression> arguments) |
MethodCall(Span span,
MemberAccess method,
List<Expression> arguments,
boolean inLinq) |
| 限定符和类型 | 方法和说明 |
|---|---|
void |
clearCachedArguments() |
Object |
evaluate(MagicScriptContext context,
Scope scope) |
List<Expression> |
getArguments()
Returns the list of expressions to be passed to the function as arguments.
|
Object[] |
getCachedArguments()
Returns a scratch buffer to store arguments in when calling the function in
AstInterpreter. |
JavaInvoker<Method> |
getCachedMethod()
Returns the cached member descriptor as returned by
AbstractReflection.getMethod(Object, String, Object...). |
MemberAccess |
getMethod()
Returns the method to call.
|
Expression |
getObject()
Returns the object on which to call the method.
|
void |
setCachedMethod(JavaInvoker<Method> cachedMethod)
Sets the method descriptor as returned by
AbstractReflection.getMethod(Object, String, Object...) for faster lookups. |
public MethodCall(Span span, MemberAccess method, List<Expression> arguments)
public MethodCall(Span span, MemberAccess method, List<Expression> arguments, boolean inLinq)
public Expression getObject()
public MemberAccess getMethod()
public List<Expression> getArguments()
public JavaInvoker<Method> getCachedMethod()
AbstractReflection.getMethod(Object, String, Object...). Seepublic void setCachedMethod(JavaInvoker<Method> cachedMethod)
AbstractReflection.getMethod(Object, String, Object...) for faster lookups.
Called by AstInterpreter the first time this node is evaluated. Subsequent evaluations can use the cached
descriptor, avoiding a costly reflective lookup.public Object[] getCachedArguments()
AstInterpreter. Avoids generating
garbage.public void clearCachedArguments()
public Object evaluate(MagicScriptContext context, Scope scope)
Copyright © 2020–2021. All rights reserved.