Java Doc for MethodUtilities.java in  » Web-Framework » jpublish » com » anthonyeden » lib » util » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Web Framework » jpublish » com.anthonyeden.lib.util 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   com.anthonyeden.lib.util.MethodUtilities

MethodUtilities
public class MethodUtilities (Code)
Utilities for invoking methods at runtime using reflection.
author:
   Anthony Eden




Method Summary
public static  MethodgetDeclaredMethod(Class targetClass, String name, Class paramClass)
     Get the declared method with the given name and with a single argument of the type specified by paramClass.
public static  MethodgetDeclaredMethod(Class targetClass, String name, Class[] paramClasses)
     Get the declared method with the given name and with arguments of the types specified by paramClasses.
public static  MethodgetMethod(Class targetClass, String name, Class paramClass)
     Get the method with the given name and with a single argument of the type specified by paramClass.
public static  MethodgetMethod(Class targetClass, String name, Class[] paramClasses)
     Get the method with the given name and with arguments of the types specified by paramClasses.
public static  Objectinvoke(Method method, Object target, Object arg)
     Invoke the given method.
public static  Objectinvoke(Method method, Object target, Object[] args)
     Invoke the given method.
public static  Objectinvoke(String methodName, Object target, Object arg)
     Invoke the given method.
public static  Objectinvoke(String methodName, Object target, Object[] args)
     Invoke the given method.
public static  Objectinvoke(String methodName, Object target, Class targetClass, Object[] args)
     Invoke the given method.
public static  Objectinvoke(String methodName, Object target, Class targetClass, Object arg)
     Invoke the given method.
public static  ObjectinvokeDeclared(String methodName, Object target, Object arg)
     Invoke the given method.
public static  ObjectinvokeDeclared(String methodName, Object target, Object[] args)
     Invoke the given method.



Method Detail
getDeclaredMethod
public static Method getDeclaredMethod(Class targetClass, String name, Class paramClass) throws NoSuchMethodException, SecurityException(Code)
Get the declared method with the given name and with a single argument of the type specified by paramClass. The paramClass may be null in which case the method should have no arguments.
Parameters:
  targetClass - The target class
Parameters:
  name - The method name
Parameters:
  paramClass - The single parameter class (may be null) The declared Method
throws:
  SecurityException -
throws:
  NoSuchMethodException -



getDeclaredMethod
public static Method getDeclaredMethod(Class targetClass, String name, Class[] paramClasses) throws NoSuchMethodException, SecurityException(Code)
Get the declared method with the given name and with arguments of the types specified by paramClasses.
Parameters:
  targetClass - The target class
Parameters:
  name - The method name
Parameters:
  paramClasses - An array of parameter classes The declared Method
throws:
  SecurityException -
throws:
  NoSuchMethodException -



getMethod
public static Method getMethod(Class targetClass, String name, Class paramClass) throws NoSuchMethodException, SecurityException(Code)
Get the method with the given name and with a single argument of the type specified by paramClass. The paramClass may be null in which case the method should have no arguments.
Parameters:
  targetClass - The target class
Parameters:
  name - The method name
Parameters:
  paramClass - The single parameter class (may be null) The Method
throws:
  SecurityException -
throws:
  NoSuchMethodException -



getMethod
public static Method getMethod(Class targetClass, String name, Class[] paramClasses) throws NoSuchMethodException, SecurityException(Code)
Get the method with the given name and with arguments of the types specified by paramClasses. If the method is not found then a method which accepts superclasses of the current arguments will be returned, if possible.
Parameters:
  targetClass - The target class
Parameters:
  name - The method name
Parameters:
  paramClasses - An array of parameter classes The Method
throws:
  SecurityException -
throws:
  NoSuchMethodException -



invoke
public static Object invoke(Method method, Object target, Object arg) throws IllegalAccessException, IllegalArgumentException, InvocationTargetException(Code)
Invoke the given method. This method is a convenience method which creates an array of arguments with the single arg value. This is necessary because the Method.invoke() method only accepts an array of argument objects.
Parameters:
  method - The method
Parameters:
  target - The target Object
Parameters:
  arg - A single argument The return object or null
throws:
  IllegalAccessException -
throws:
  IllegalArgumentException -
throws:
  InvocationTargetException -



invoke
public static Object invoke(Method method, Object target, Object[] args) throws IllegalAccessException, IllegalArgumentException, InvocationTargetException(Code)
Invoke the given method. This method actually invokes the target method with the given arguments.
Parameters:
  method - The Method
Parameters:
  target - The target Object
Parameters:
  args - An array of argument Objects The return value
throws:
  IllegalAccessException -
throws:
  IllegalArgumentException -
throws:
  InvocationTargetException -



invoke
public static Object invoke(String methodName, Object target, Object arg) throws IllegalAccessException, IllegalArgumentException, InvocationTargetException, NoSuchMethodException, SecurityException(Code)
Invoke the given method. The target object is used to determine the target class and which is then used to get a Method object. This method is a convenience method which creates an array of arguments with the single arg value. This is necessary because the Method.invoke() method only accepts an array of argument objects.
Parameters:
  methodName - The method name
Parameters:
  target - The target Object
Parameters:
  arg - A single argument The return object or null
throws:
  IllegalAccessException -
throws:
  IllegalArgumentException -
throws:
  InvocationTargetException -
throws:
  NoSuchMethodException -
throws:
  SecurityException -



invoke
public static Object invoke(String methodName, Object target, Object[] args) throws IllegalAccessException, IllegalArgumentException, InvocationTargetException, NoSuchMethodException, SecurityException(Code)
Invoke the given method. The target object is used to determine the target class and which is then used to get a Method object.
Parameters:
  methodName - The Method name
Parameters:
  target - The target Object
Parameters:
  args - An array of argument Objects The return value
throws:
  IllegalAccessException -
throws:
  IllegalArgumentException -
throws:
  InvocationTargetException -
throws:
  NoSuchMethodException -
throws:
  SecurityException -



invoke
public static Object invoke(String methodName, Object target, Class targetClass, Object[] args) throws IllegalAccessException, IllegalArgumentException, InvocationTargetException, NoSuchMethodException, SecurityException(Code)
Invoke the given method. The target object may be null in which case the target class is used and the method must be a static method.
Parameters:
  methodName - The method name
Parameters:
  target - The target Object
Parameters:
  targetClass - The Class of the target object
Parameters:
  args - An array of argument Objects The return value
throws:
  IllegalAccessException -
throws:
  IllegalArgumentException -
throws:
  InvocationTargetException -
throws:
  NoSuchMethodException -
throws:
  SecurityException -



invoke
public static Object invoke(String methodName, Object target, Class targetClass, Object arg) throws IllegalAccessException, IllegalArgumentException, InvocationTargetException, NoSuchMethodException, SecurityException(Code)
Invoke the given method. This method is a convenience method for invoking single argument methods.
Parameters:
  methodName - The method name
Parameters:
  target - The target Object
Parameters:
  targetClass - The Class of the target object
Parameters:
  arg - A single argument The return value
throws:
  IllegalAccessException -
throws:
  IllegalArgumentException -
throws:
  InvocationTargetException -
throws:
  NoSuchMethodException -
throws:
  SecurityException -



invokeDeclared
public static Object invokeDeclared(String methodName, Object target, Object arg) throws IllegalAccessException, IllegalArgumentException, InvocationTargetException, NoSuchMethodException, SecurityException(Code)
Invoke the given method. This method is a convenience method for invoking single argument methods. The argument's class is obtained from the argument object.
Parameters:
  methodName - The method name
Parameters:
  target - The target Object
Parameters:
  arg - A single argument The return value
throws:
  IllegalAccessException -
throws:
  IllegalArgumentException -
throws:
  InvocationTargetException -
throws:
  NoSuchMethodException -
throws:
  SecurityException -



invokeDeclared
public static Object invokeDeclared(String methodName, Object target, Object[] args) throws IllegalAccessException, IllegalArgumentException, InvocationTargetException, NoSuchMethodException, SecurityException(Code)
Invoke the given method. This method is a convenience method for invoking single argument methods. The argument's class is obtained from the argument object.
Parameters:
  methodName - The method name
Parameters:
  target - The target Object
Parameters:
  args - An array of arguments The return value
throws:
  IllegalAccessException -
throws:
  IllegalArgumentException -
throws:
  InvocationTargetException -
throws:
  NoSuchMethodException -
throws:
  SecurityException -



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.