Java Doc for Invoke.java in  » Scripting » jscheme » jsint » 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 » Scripting » jscheme » jsint 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   jsint.Invoke

Invoke
public class Invoke (Code)
Provides dynamic Java method invocation through Java's Reflection interface. For a good discussion of a Scheme implementation, and the issues involved with dynamic method invocation in Java see:

Michael Travers, Java Q & A, Dr. Dobb's Journal, Jan., 2000, p. 103-112.

Primitive types are not widened because it would make method selection more ambiguous. By memoizing constructorTable() and methodTable() dynamic method lookup can be done without consing.

You'll notice that Java doesn't make this very easy. For example it would be nice if Method and Constructor shared an Invokable interface.

Privileged methods can be invoked if the JVM allows it.

The name of a method to be invoked can be any nonnull Object with a .toString() that names a method. It should probably be changed to String.



Field Summary
final static  booleanALLOW_PRIVATE_ACCESS
     In some situations you may not be able to get declared methods.
final public static  intBUCKET_SIZE
     Each bucket in an method table contains a Class[] of parameterTypes and the corresponding method or constructor.
static  MethodSETACCESSIBLE
     Check that this JVM has AccessibleObject.
final public static  HashtableconstructorCache
    
final public static  HashtableconstructorCachePriv
    
final public static  HashtableinstanceCache
     Instance method name -> Class -> parameter[]/method array.
final public static  HashtablestaticCache
     Static method name -> Class -> parameter[]/method array.


Method Summary
public static  Object[]constructorTable(String c, boolean isPrivileged)
     Return the constructor table for the named class.
public static  Object[]constructorTable0(String c)
    
public static  Object[]constructorTable0Priv(String c)
    
public static  ConstructorfindConstructor(Object target, Pair types)
     Look up a particular constructor given its name, and the name of its declaring class, and a list of argument type names.
public static  ObjectfindMethod(Object[] methods, Object[] args)
     Find the most applicable method.
public static  MethodfindMethod(String name, Object target, Pair types)
     Look up a particular method given its name, and the name of its declaring class, and a list of argument type names.
static  ObjectfindMethodNoOpt(Object[] methods, Object[] args)
    
public static  Object[]getCachedMethodTable(Class c, String name, boolean isStatic)
    
public static  HashtablegetClassTable(String name, boolean isStatic)
     Returns a Class -> prameter[]/method array for the method named name.
public static  Method[]getMethods(Class c, boolean isPrivileged)
     Return all the methods for this class.
public static  ObjectinvokeConstructor(String c, Object[] args)
    
public static  ObjectinvokeInstance(Object target, String name, Object[] args, boolean isPrivileged)
    
public static  ObjectinvokeMethod(Class c, Object target, String name, Object[] args, boolean isStatic, boolean isPrivileged)
    
public static  ObjectinvokeRawConstructor(Constructor m, Object[] args)
    
public static  ObjectinvokeRawMethod(Method m, Object target, Object[] args)
    
public static  ObjectinvokeStatic(Class c, String name, Object[] args)
    
public static  booleanisApplicable(Class[] types, Object[] args)
    
static  Object[]makeAccessible(Object[] items)
     Items should be of type AccessibleObject[] but we can't say that on JVM's older than JDK 1.2

Also used by JavaField.

public static  Object[]methodTable(Class c, String name, boolean isStatic, boolean isPrivileged)
    
public static  Object[]methodTable0(Class c, String name, boolean isStatic, boolean isPrivileged)
    
public static  Object[]methodTableLookup(Class c, String name, boolean isStatic, boolean isPrivileged)
    
public static  Object[]methodTableLookupInstance(Class c, String name)
    
public static  Object[]methodTableLookupInstance(Class c, String name, boolean isPrivileged)
    
public static  Object[]methodTableLookupStatic(Class c, String name, boolean isPrivileged)
    
public static  VectormethodVector(Class c, String name)
    
public static  VectormethodVector(Class c, String name, boolean isPrivileged)
    
public static  VectormethodVectorMerge(Class c, String name, Vector result)
     Add new methods to your superclasses table.
public static  VectormethodVectorMerge(Class c, String name, Vector result, boolean isPrivileged)
    
public static  booleanparameterTypesMatch(Class[] p1, Class[] p2)
    
public static  Objectpeek(Object target, String name)
    
public static  ObjectpeekStatic(Class c, String name)
    
public static  Objectpoke(Object target, String name, Object value)
    
public static  ObjectpokeStatic(Class c, String name, Object value)
    
public static  voidputCachedMethodTable(Class c, String name, boolean isStatic, Object value)
    
public static  Class[]toClassArray(Pair types, int n)
    

Field Detail
ALLOW_PRIVATE_ACCESS
final static boolean ALLOW_PRIVATE_ACCESS(Code)
In some situations you may not be able to get declared methods. We only try once.



BUCKET_SIZE
final public static int BUCKET_SIZE(Code)
Each bucket in an method table contains a Class[] of parameterTypes and the corresponding method or constructor. *



SETACCESSIBLE
static Method SETACCESSIBLE(Code)
Check that this JVM has AccessibleObject. We only try once.



constructorCache
final public static Hashtable constructorCache(Code)



constructorCachePriv
final public static Hashtable constructorCachePriv(Code)



instanceCache
final public static Hashtable instanceCache(Code)
Instance method name -> Class -> parameter[]/method array. *



staticCache
final public static Hashtable staticCache(Code)
Static method name -> Class -> parameter[]/method array. *





Method Detail
constructorTable
public static Object[] constructorTable(String c, boolean isPrivileged)(Code)
Return the constructor table for the named class. *



constructorTable0
public static Object[] constructorTable0(String c)(Code)



constructorTable0Priv
public static Object[] constructorTable0Priv(String c)(Code)



findConstructor
public static Constructor findConstructor(Object target, Pair types)(Code)
Look up a particular constructor given its name, and the name of its declaring class, and a list of argument type names.

This is only used by (constructor).




findMethod
public static Object findMethod(Object[] methods, Object[] args)(Code)
Find the most applicable method. For instance methods getMethods() has already handled the "this" argument, so instance and static methods are matched the same way. *



findMethod
public static Method findMethod(String name, Object target, Pair types)(Code)
Look up a particular method given its name, and the name of its declaring class, and a list of argument type names.

This is only used by (method).




findMethodNoOpt
static Object findMethodNoOpt(Object[] methods, Object[] args)(Code)



getCachedMethodTable
public static Object[] getCachedMethodTable(Class c, String name, boolean isStatic)(Code)



getClassTable
public static Hashtable getClassTable(String name, boolean isStatic)(Code)
Returns a Class -> prameter[]/method array for the method named name. *



getMethods
public static Method[] getMethods(Class c, boolean isPrivileged)(Code)
Return all the methods for this class. If you can't get all, for some reason,, just return the public ones.

Memoizable.




invokeConstructor
public static Object invokeConstructor(String c, Object[] args)(Code)



invokeInstance
public static Object invokeInstance(Object target, String name, Object[] args, boolean isPrivileged)(Code)



invokeMethod
public static Object invokeMethod(Class c, Object target, String name, Object[] args, boolean isStatic, boolean isPrivileged)(Code)



invokeRawConstructor
public static Object invokeRawConstructor(Constructor m, Object[] args)(Code)



invokeRawMethod
public static Object invokeRawMethod(Method m, Object target, Object[] args)(Code)



invokeStatic
public static Object invokeStatic(Class c, String name, Object[] args)(Code)



isApplicable
public static boolean isApplicable(Class[] types, Object[] args)(Code)



makeAccessible
static Object[] makeAccessible(Object[] items)(Code)
Items should be of type AccessibleObject[] but we can't say that on JVM's older than JDK 1.2

Also used by JavaField.




methodTable
public static Object[] methodTable(Class c, String name, boolean isStatic, boolean isPrivileged)(Code)



methodTable0
public static Object[] methodTable0(Class c, String name, boolean isStatic, boolean isPrivileged)(Code)



methodTableLookup
public static Object[] methodTableLookup(Class c, String name, boolean isStatic, boolean isPrivileged)(Code)



methodTableLookupInstance
public static Object[] methodTableLookupInstance(Class c, String name)(Code)



methodTableLookupInstance
public static Object[] methodTableLookupInstance(Class c, String name, boolean isPrivileged)(Code)



methodTableLookupStatic
public static Object[] methodTableLookupStatic(Class c, String name, boolean isPrivileged)(Code)



methodVector
public static Vector methodVector(Class c, String name)(Code)



methodVector
public static Vector methodVector(Class c, String name, boolean isPrivileged)(Code)



methodVectorMerge
public static Vector methodVectorMerge(Class c, String name, Vector result)(Code)
Add new methods to your superclasses table. *



methodVectorMerge
public static Vector methodVectorMerge(Class c, String name, Vector result, boolean isPrivileged)(Code)



parameterTypesMatch
public static boolean parameterTypesMatch(Class[] p1, Class[] p2)(Code)
Do the paramter types of an instance method match? *



peek
public static Object peek(Object target, String name)(Code)



peekStatic
public static Object peekStatic(Class c, String name)(Code)



poke
public static Object poke(Object target, String name, Object value)(Code)



pokeStatic
public static Object pokeStatic(Class c, String name, Object value)(Code)



putCachedMethodTable
public static void putCachedMethodTable(Class c, String name, boolean isStatic, Object value)(Code)



toClassArray
public static Class[] toClassArray(Pair types, int n)(Code)



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.