|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectorg.onemind.commons.invoke.AbstractInvocable
public abstract class AbstractInvocable
An invocable that contain a list of invocable functions to be invoke upon. In current implementation, it can only contains on function with the specific name (regardless of arg types) TODO: improve to allow multiple functions with same name (different args)
| Constructor Summary | |
|---|---|
AbstractInvocable()
|
|
| Method Summary | |
|---|---|
void |
addFunction(InvocableFunction function)
Add an function |
boolean |
canInvoke(java.lang.String functionName,
java.lang.Object[] args)
whether the function can be invoke with the arguments |
InvocableFunction |
getFunction(java.lang.String functionName,
java.lang.Class[] argTypes)
|
InvocableFunction |
getFunction(java.lang.String functionName,
java.lang.Object[] args)
Get the function |
java.util.Collection |
getFunctions()
Get all the functions |
java.lang.Object |
invoke(java.lang.String functionName,
java.lang.Object[] args)
invoke the function with the arguments provided |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public AbstractInvocable()
| Method Detail |
|---|
public void addFunction(InvocableFunction function)
functionName - the function namefunction - the function
public InvocableFunction getFunction(java.lang.String functionName,
java.lang.Object[] args)
getFunction in interface InvocablefunctionName - the function nameargs - the arguments
public InvocableFunction getFunction(java.lang.String functionName,
java.lang.Class[] argTypes)
public boolean canInvoke(java.lang.String functionName,
java.lang.Object[] args)
canInvoke in interface InvocablefunctionName - the function nameargs - the arguments
public java.lang.Object invoke(java.lang.String functionName,
java.lang.Object[] args)
throws java.lang.Exception
invoke in interface InvocablefunctionName - the function nameargs - the arguments
java.lang.Exception - if there's problem invoking the functionpublic java.util.Collection getFunctions()
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||