|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.opengts.util.MethodAction
public class MethodAction
Field Summary | |
---|---|
static java.lang.String |
CONSTRUCTOR
|
Constructor Summary | |
---|---|
MethodAction(java.lang.Object targ)
Constructor |
|
MethodAction(java.lang.Object targ,
java.lang.Class... argClass)
Constructor |
|
MethodAction(java.lang.Object targ,
java.lang.Class[] argClass,
java.lang.Object[] args)
Constructor |
|
MethodAction(java.lang.Object targ,
java.lang.String methName)
Constructor |
|
MethodAction(java.lang.Object targ,
java.lang.String methName,
java.lang.Class... argClass)
Constructor |
|
MethodAction(java.lang.Object targ,
java.lang.String methName,
java.lang.Class[] argClass,
java.lang.Object[] args)
Constructor |
Method Summary | |
---|---|
protected static java.lang.String |
_beanMethodName(java.lang.String prefix,
java.lang.String fieldName)
Returns the bean method name for the specified field |
void |
actionPerformed(java.awt.event.ActionEvent ae)
ActionListener interface execution |
java.lang.Object[] |
getArgs()
Returns an array of currently defined arguments |
java.lang.Object |
getReturnValue()
Gets the returned value from the last MethodAction invocation |
java.lang.Object |
getTarget()
Returns the MethodAction target (may be a Class or Object instance) |
static MethodAction |
GetterMethod(java.lang.Object targ,
java.lang.String fieldName)
Returns a MethodAction instance which represents a bean field 'getter' method. |
static java.lang.String |
getterMethodName(java.lang.String fieldName)
Returns the bean 'getter' method name for the specified field |
java.lang.Object |
invoke()
Invokes this MethodAction with the currently specified array/list of arguments |
java.lang.Object |
invoke(java.lang.Object... args)
Invokes this MethodAction with the specified array/list of arguments |
void |
invokeAndWait()
Queues the invocation of this MethodAction on the EventQueue, and waits for the EventQueue |
static void |
invokeAndWait(java.lang.Runnable r)
Queues the invocation of the specified Runnable on the EventQueue, and waits for the EventQueue thread to complete execution of the specified Runnable. |
void |
invokeDelayed(int delayMillis)
Place this MethodAction object in the current EventQueue execution stack to be executed after the specified initial delay. |
static void |
invokeDelayed(int delayMillis,
java.lang.Runnable r)
Place the Runnable object in the current EventQueue execution stack to be executed after the specified initial delay. |
static java.lang.Object |
InvokeGetter(java.lang.Object targ,
java.lang.String fieldName)
Invokes a 'getter' method on the specified target for the specified field name |
void |
invokeLater()
Queues the invocation of this MethodAction on the EventQueue |
static void |
invokeLater(java.awt.event.ActionListener al,
java.awt.event.ActionEvent ae)
Queues the invocation of the specified ActionListener on the EventQueue |
static void |
invokeLater(java.lang.Runnable r)
Queues the invocation of the specified Runnable on the EventQueue |
static void |
InvokeSetter(java.lang.Object targ,
java.lang.String fieldName,
boolean value)
Invokes a 'setter' method on the specified target for the specified field name |
static void |
InvokeSetter(java.lang.Object targ,
java.lang.String fieldName,
java.lang.Class valClass,
java.lang.Object value)
Invokes a 'setter' method on the specified target for the specified field name |
static void |
InvokeSetter(java.lang.Object targ,
java.lang.String fieldName,
double value)
Invokes a 'setter' method on the specified target for the specified field name |
static void |
InvokeSetter(java.lang.Object targ,
java.lang.String fieldName,
float value)
Invokes a 'setter' method on the specified target for the specified field name |
static void |
InvokeSetter(java.lang.Object targ,
java.lang.String fieldName,
int value)
Invokes a 'setter' method on the specified target for the specified field name |
static void |
InvokeSetter(java.lang.Object targ,
java.lang.String fieldName,
long value)
Invokes a 'setter' method on the specified target for the specified field name |
static void |
InvokeSetter(java.lang.Object targ,
java.lang.String fieldName,
java.lang.String value)
Invokes a 'setter' method on the specified target for the specified field name |
static boolean |
isDispatchThread()
Returns true if the calling Thread is the event dispatch thread |
static void |
main(java.lang.String[] argv)
Command-line test/debug |
static java.lang.Object |
newInstance(java.lang.String className)
Create a new instance of the specified class name |
void |
run()
Runs this MethodAction now |
void |
setArgs(java.lang.Object... args)
Sets the actual arguments to pass to the method at the time of invocation |
static MethodAction |
SetterMethod(java.lang.Object targ,
java.lang.String fieldName,
java.lang.Class... argType)
Returns a MethodAction instance which represents a bean field 'setter' method. |
static java.lang.String |
setterMethodName(java.lang.String fieldName)
Returns the bean 'setter' method name for the specified field |
static int |
test(java.lang.String m,
int x)
Command-line test method |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String CONSTRUCTOR
Constructor Detail |
---|
public MethodAction(java.lang.Object targ) throws java.lang.NoSuchMethodException, java.lang.ClassNotFoundException
targ
- The Object target (a class instance for static methods)
java.lang.NoSuchMethodException
java.lang.ClassNotFoundException
public MethodAction(java.lang.Object targ, java.lang.String methName) throws java.lang.NoSuchMethodException, java.lang.ClassNotFoundException
targ
- The Object target (a class instance for static methods)methName
- A method name
java.lang.NoSuchMethodException
java.lang.ClassNotFoundException
public MethodAction(java.lang.Object targ, java.lang.Class... argClass) throws java.lang.NoSuchMethodException, java.lang.ClassNotFoundException
targ
- The Object target (a class instance for static methods)argClass
- An array/list of argument class types
java.lang.NoSuchMethodException
java.lang.ClassNotFoundException
public MethodAction(java.lang.Object targ, java.lang.String methName, java.lang.Class... argClass) throws java.lang.NoSuchMethodException, java.lang.ClassNotFoundException
targ
- The Object target (a class instance for static methods)methName
- A method nameargClass
- An array/list of argument class types
java.lang.NoSuchMethodException
java.lang.ClassNotFoundException
public MethodAction(java.lang.Object targ, java.lang.Class[] argClass, java.lang.Object[] args) throws java.lang.NoSuchMethodException, java.lang.ClassNotFoundException
targ
- The Object target (a class instance for static methods)argClass
- An array/list of argument class typesargs
- An array of the actual method arguments
java.lang.NoSuchMethodException
java.lang.ClassNotFoundException
public MethodAction(java.lang.Object targ, java.lang.String methName, java.lang.Class[] argClass, java.lang.Object[] args) throws java.lang.NoSuchMethodException, java.lang.ClassNotFoundException
targ
- The Object target (a class instance for static methods)methName
- A method nameargClass
- An array/list of argument class typesargs
- An array of the actual method arguments
java.lang.NoSuchMethodException
java.lang.ClassNotFoundException
Method Detail |
---|
protected static java.lang.String _beanMethodName(java.lang.String prefix, java.lang.String fieldName)
prefix
- Either "get" or "set"fieldName
- The field name
public static java.lang.String getterMethodName(java.lang.String fieldName)
fieldName
- The field name
public static java.lang.String setterMethodName(java.lang.String fieldName)
fieldName
- The field name
public static MethodAction GetterMethod(java.lang.Object targ, java.lang.String fieldName) throws java.lang.NoSuchMethodException, java.lang.ClassNotFoundException
targ
- The Object targetfieldName
- The field name for which the 'getter' is returned
java.lang.NoSuchMethodException
- if the 'getter' method does not exist
java.lang.ClassNotFoundException
public static java.lang.Object InvokeGetter(java.lang.Object targ, java.lang.String fieldName) throws java.lang.NoSuchMethodException, java.lang.ClassNotFoundException, java.lang.Throwable
targ
- The Object targetfieldName
- The field name for which the 'getter' is returned
java.lang.NoSuchMethodException
- if the 'getter' method does not exist
java.lang.ClassNotFoundException
java.lang.Throwable
public static MethodAction SetterMethod(java.lang.Object targ, java.lang.String fieldName, java.lang.Class... argType) throws java.lang.NoSuchMethodException, java.lang.ClassNotFoundException
targ
- The Object targetfieldName
- The field name for which the 'getter' is returned
java.lang.NoSuchMethodException
- if the 'setter' method does not exist
java.lang.ClassNotFoundException
public static void InvokeSetter(java.lang.Object targ, java.lang.String fieldName, java.lang.Class valClass, java.lang.Object value) throws java.lang.NoSuchMethodException, java.lang.ClassNotFoundException, java.lang.Throwable
targ
- The Object targetfieldName
- The field name for which the 'getter' is returnedvalue
- The value to 'set'.
java.lang.NoSuchMethodException
- if the 'getter' method does not exist
java.lang.ClassNotFoundException
java.lang.Throwable
public static void InvokeSetter(java.lang.Object targ, java.lang.String fieldName, java.lang.String value) throws java.lang.NoSuchMethodException, java.lang.ClassNotFoundException, java.lang.Throwable
targ
- The Object targetfieldName
- The field name for which the 'getter' is returnedvalue
- The value to 'set'.
java.lang.NoSuchMethodException
- if the 'getter' method does not exist
java.lang.ClassNotFoundException
java.lang.Throwable
public static void InvokeSetter(java.lang.Object targ, java.lang.String fieldName, boolean value) throws java.lang.NoSuchMethodException, java.lang.ClassNotFoundException, java.lang.Throwable
targ
- The Object targetfieldName
- The field name for which the 'getter' is returnedvalue
- The value to 'set'.
java.lang.NoSuchMethodException
- if the 'getter' method does not exist
java.lang.ClassNotFoundException
java.lang.Throwable
public static void InvokeSetter(java.lang.Object targ, java.lang.String fieldName, int value) throws java.lang.NoSuchMethodException, java.lang.ClassNotFoundException, java.lang.Throwable
targ
- The Object targetfieldName
- The field name for which the 'getter' is returnedvalue
- The value to 'set'.
java.lang.NoSuchMethodException
- if the 'getter' method does not exist
java.lang.ClassNotFoundException
java.lang.Throwable
public static void InvokeSetter(java.lang.Object targ, java.lang.String fieldName, long value) throws java.lang.NoSuchMethodException, java.lang.ClassNotFoundException, java.lang.Throwable
targ
- The Object targetfieldName
- The field name for which the 'getter' is returnedvalue
- The value to 'set'.
java.lang.NoSuchMethodException
- if the 'getter' method does not exist
java.lang.ClassNotFoundException
java.lang.Throwable
public static void InvokeSetter(java.lang.Object targ, java.lang.String fieldName, float value) throws java.lang.NoSuchMethodException, java.lang.ClassNotFoundException, java.lang.Throwable
targ
- The Object targetfieldName
- The field name for which the 'getter' is returnedvalue
- The value to 'set'.
java.lang.NoSuchMethodException
- if the 'getter' method does not exist
java.lang.ClassNotFoundException
java.lang.Throwable
public static void InvokeSetter(java.lang.Object targ, java.lang.String fieldName, double value) throws java.lang.NoSuchMethodException, java.lang.ClassNotFoundException, java.lang.Throwable
targ
- The Object targetfieldName
- The field name for which the 'getter' is returnedvalue
- The value to 'set'.
java.lang.NoSuchMethodException
- if the 'getter' method does not exist
java.lang.ClassNotFoundException
java.lang.Throwable
public java.lang.Object getTarget()
public void setArgs(java.lang.Object... args)
args
- An array/list of method argumentspublic java.lang.Object[] getArgs()
public java.lang.Object invoke(java.lang.Object... args) throws java.lang.Throwable
args
- An array/list of arguments
java.lang.Throwable
public java.lang.Object invoke() throws java.lang.Throwable
java.lang.Throwable
public java.lang.Object getReturnValue()
public static void invokeDelayed(int delayMillis, java.lang.Runnable r)
delayMillis
- The number of milliseconds to wait befor executing the specified Runnable.
This method will still return immediately.r
- The Runnable instance to execute (ie. call the "run()" method)public void invokeDelayed(int delayMillis)
delayMillis
- The number of milliseconds to wait befor executing this MethodAction.
This method will still return immediately.public static void invokeLater(java.awt.event.ActionListener al, java.awt.event.ActionEvent ae)
al
- The ActionListener to executeae
- The ActionEvent to pass to the ActionListenerpublic static void invokeLater(java.lang.Runnable r)
r
- The Runnable to executepublic static void invokeAndWait(java.lang.Runnable r) throws java.lang.InterruptedException, java.lang.reflect.InvocationTargetException
r
- The Runnable to execute
java.lang.InterruptedException
java.lang.reflect.InvocationTargetException
public void invokeLater()
public void invokeAndWait() throws java.lang.InterruptedException, java.lang.reflect.InvocationTargetException
java.lang.InterruptedException
java.lang.reflect.InvocationTargetException
public void run()
run
in interface java.lang.Runnable
public void actionPerformed(java.awt.event.ActionEvent ae)
actionPerformed
in interface java.awt.event.ActionListener
ae
- The ActionEventpublic static boolean isDispatchThread()
public static java.lang.Object newInstance(java.lang.String className) throws java.lang.NoSuchMethodException, java.lang.ClassNotFoundException, java.lang.InstantiationException, java.lang.IllegalAccessException
className
- The class name to instantiate
java.lang.NoSuchMethodException
java.lang.ClassNotFoundException
java.lang.InstantiationException
java.lang.IllegalAccessException
public static int test(java.lang.String m, int x)
m
- A Stringx
- An int
public static void main(java.lang.String[] argv)
argv
- The command-line args
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |