public abstract class OpenMethodDispatcher extends Object implements IOpenMethod
IOpenMehtod interface for method overload support.EMPTY, LONG, REGULAR, SHORT| Constructor and Description |
|---|
OpenMethodDispatcher() |
| Modifier and Type | Method and Description |
|---|---|
void |
addMethod(IOpenMethod candidate)
Try to add method as overloaded version of decorated method.
|
protected void |
decorate(IOpenMethod delegate)
Creates new instance of decorator.
|
IOpenMethod |
findMatchingMethod(IRuntimeEnv env)
Finds appropriate method using runtime context.
|
protected abstract IOpenMethod |
findMatchingMethod(List<IOpenMethod> candidates,
IRuntimeContext context)
Resolve best matching method to invoke.
|
List<IOpenMethod> |
getCandidates() |
IOpenClass |
getDeclaringClass()
Gets the declaring class.
|
abstract TableSyntaxNode |
getDispatcherTable() |
String |
getDisplayName(int mode)
Gets the user-friendly name.
|
IMemberMetaInfo |
getInfo()
Gets
null. |
IOpenMethod |
getMethod()
Gets
this. |
String |
getName()
Gets the method name.
|
IMethodSignature |
getSignature()
Gets the signature of method.
|
IOpenMethod |
getTargetMethod() |
IOpenClass |
getType()
Gets the type of method.
|
Object |
invoke(Object target,
Object[] params,
IRuntimeEnv env)
Invokes appropriate method using runtime context.
|
protected Object |
invokeInner(Object target,
Object[] params,
IRuntimeEnv env)
Invokes appropriate method using runtime context.
|
boolean |
isConstructor() |
boolean |
isStatic() |
protected IOpenMethod |
useActiveOrNewerVersion(IOpenMethod existedMethod,
IOpenMethod newMethod,
MethodKey key)
In case we have several versions of one table we should add only the newest or active version of table.
|
protected void decorate(IOpenMethod delegate)
delegate - method to decoratepublic IMethodSignature getSignature()
getSignature in interface IOpenMethodHeaderpublic IOpenClass getDeclaringClass()
getDeclaringClass in interface IOpenMemberpublic IMemberMetaInfo getInfo()
null. The decorator hasn't info about overloaded methods.getInfo in interface IOpenMemberpublic IOpenClass getType()
getType in interface IOpenMemberpublic boolean isStatic()
isStatic in interface IOpenMemberpublic boolean isConstructor()
isConstructor in interface IOpenMethodpublic String getDisplayName(int mode)
getDisplayName in interface INamedThingpublic String getName()
getName in interface INamedThingpublic IOpenMethod getMethod()
this. The decorator can't resolve which overloaded method should be returned.getMethod in interface IMethodCallerpublic List<IOpenMethod> getCandidates()
public Object invoke(Object target, Object[] params, IRuntimeEnv env)
public IOpenMethod findMatchingMethod(IRuntimeEnv env)
protected Object invokeInner(Object target, Object[] params, IRuntimeEnv env)
protected IOpenMethod useActiveOrNewerVersion(IOpenMethod existedMethod, IOpenMethod newMethod, MethodKey key)
newMethod - The methods that we are trying to add.key - Method key of these methods based on signature.existedMethod - The existing method.public void addMethod(IOpenMethod candidate)
candidate - method to addprotected abstract IOpenMethod findMatchingMethod(List<IOpenMethod> candidates, IRuntimeContext context)
candidates - list of candidatescontext - runtime contextpublic IOpenMethod getTargetMethod()
public abstract TableSyntaxNode getDispatcherTable()
Copyright © 2004–2019 OpenL Tablets. All rights reserved.