|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.pietschy.command.Command
org.pietschy.command.ActionCommand
org.pietschy.command.ReflectionCommand
public class ReflectionCommand
The ReflectionCommand invokes a target method using reflection.
Field Summary |
---|
Fields inherited from class org.pietschy.command.ActionCommand |
---|
HINT_ACTION_EVENT, HINT_INVOKER, HINT_INVOKER_WINDOW, HINT_MODIFIERS |
Fields inherited from class org.pietschy.command.Command |
---|
internalLog, listenerList, pcs |
Constructor Summary | |
---|---|
ReflectionCommand(java.lang.String commandId,
java.lang.Class clazz,
java.lang.String methodName)
Creates a new reflection command that invokess a static no arg method. |
|
ReflectionCommand(java.lang.String commandId,
java.lang.Class clazz,
java.lang.String methodName,
java.lang.Class[] methodArgs)
Creates a new reflection command that invokes a static class method with arguments. |
|
ReflectionCommand(java.lang.String commandId,
java.lang.Object instance,
java.lang.String methodName)
Creates a new reflection command that invokes a non static method on the specified object. |
|
ReflectionCommand(java.lang.String commandId,
java.lang.Object instance,
java.lang.String methodName,
java.lang.Class[] methodArgs)
|
|
ReflectionCommand(java.lang.String commandId,
java.lang.String className,
java.lang.String methodName)
Creates a new reflection command that invokes a static no arg method. |
Method Summary | |
---|---|
protected java.lang.Object[] |
getInvocationArgs()
Gets any arguments required by the delegate. |
protected void |
handleExecute()
Main entry point for command subclasses that must be implemented to provide command specific behaviour. |
protected void |
handleInvocationException(java.lang.Exception e)
Called to handle any exceptions that occur during the invocation of the delegate method. |
Methods inherited from class org.pietschy.command.ActionCommand |
---|
addCommandListener, addInterceptor, areEqual, attach, configureButtonStates, detach, execute, execute, getActionAdapter, getActionAdapter, getActionCommand, getActionEvent, getHint, getHint, getHints, getInvoker, getInvokerWindow, getModifiers, installShortCut, installShortCut, postExecute, preExecute, putHint, putHints, removeCommandListener, removeInterceptor, requestDefautIn, setActionCommand, uninstallShortCut, uninstallShortCut |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface org.pietschy.command.ActionCommandExecutor |
---|
addPropertyChangeListener, addPropertyChangeListener, isEnabled, removePropertyChangeListener, removePropertyChangeListener |
Constructor Detail |
---|
public ReflectionCommand(java.lang.String commandId, java.lang.String className, java.lang.String methodName) throws java.lang.NoSuchMethodException, java.lang.ClassNotFoundException
commandId
- the id of the command.className
- the class on which the static method residesmethodName
- the name of the no arg static method.
java.lang.NoSuchMethodException
- if the method doesn't exist
java.lang.NullPointerException
- if either the instance or methodName is null.
java.lang.ClassNotFoundException
public ReflectionCommand(java.lang.String commandId, java.lang.Class clazz, java.lang.String methodName) throws java.lang.NoSuchMethodException
commandId
- the id of the command.clazz
- the class on which the static method residesmethodName
- the name of the no arg static method.
java.lang.NoSuchMethodException
- if the method doesn't exist
java.lang.NullPointerException
- if either the instance or methodName is null.public ReflectionCommand(java.lang.String commandId, java.lang.Class clazz, java.lang.String methodName, java.lang.Class[] methodArgs) throws java.lang.NoSuchMethodException
commandId
- the id of the command.clazz
- the class on which the static method resides.methodName
- the method name.methodArgs
- the arguments of the method. This may be null if the argument takes
no methods. If arguments are specified, the getInvocationArgs()
method must be
implemented to provide the arguments to the method invocation.
java.lang.NoSuchMethodException
- if the method doesn't exist
java.lang.NullPointerException
- if either the instance or methodName is null.public ReflectionCommand(java.lang.String commandId, java.lang.Object instance, java.lang.String methodName) throws java.lang.NoSuchMethodException
commandId
- the id of the commandinstance
- that target instance on which the method will be invoked.methodName
- the name of the method to invoke.
java.lang.NoSuchMethodException
- if the method doesn't exist
java.lang.NullPointerException
- if either the instance or methodName is null.public ReflectionCommand(java.lang.String commandId, java.lang.Object instance, java.lang.String methodName, java.lang.Class[] methodArgs) throws java.lang.NoSuchMethodException
commandId
- instance
- methodName
- methodArgs
- the arguments of the method. This may be null if the argument takes
no methods. If arguments are specified, the getInvocationArgs()
method must be
implemented to provide the arguments to the method invocation.
java.lang.NoSuchMethodException
- if the method doesn't exist
java.lang.NullPointerException
- if either the instance or methodName is null.Method Detail |
---|
protected final void handleExecute()
ActionCommand
This method should never be called directly to invoke a comand. All
command invocation must be performed using the ActionCommand.execute()
and
ActionCommand.execute(Map)
methods.
handleExecute
in class ActionCommand
protected java.lang.Object[] getInvocationArgs()
protected void handleInvocationException(java.lang.Exception e)
e
- the exception that occured while calling method.invoke(..)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |