public class MemberAccess extends Expression implements VariableSetter
| 构造器和说明 |
|---|
MemberAccess(Expression object,
boolean optional,
Span name,
boolean whole) |
| 限定符和类型 | 方法和说明 |
|---|---|
Object |
evaluate(MagicScriptContext context,
Scope scope) |
Field |
getCachedMember()
Returns the cached member descriptor as returned by
AbstractReflection.getField(Object, String) or |
Span |
getName()
The name of the member.
|
Expression |
getObject()
Returns the object on which to access the member.
|
boolean |
isOptional() |
boolean |
isWhole() |
void |
setCachedMember(Field cachedMember)
Sets the member descriptor as returned by
AbstractReflection.getField(Object, String) or
AbstractReflection.getMethod(Object, String, Object...) for faster member lookups. |
void |
setValue(MagicScriptContext context,
Scope scope,
Object value) |
public MemberAccess(Expression object, boolean optional, Span name, boolean whole)
public boolean isWhole()
public Expression getObject()
public Span getName()
public Field getCachedMember()
AbstractReflection.getField(Object, String) orpublic void setCachedMember(Field cachedMember)
AbstractReflection.getField(Object, String) or
AbstractReflection.getMethod(Object, String, Object...) for faster member lookups. Called by AstInterpreter the
first time this node is evaluated. Subsequent evaluations can use the cached descriptor, avoiding a costly reflective
lookup.public boolean isOptional()
public Object evaluate(MagicScriptContext context, Scope scope)
public void setValue(MagicScriptContext context, Scope scope, Object value)
setValue 在接口中 VariableSetterCopyright © 2020–2021. All rights reserved.