Java Doc for Reflect.java in  » Swing-Library » jEdit » org » gjt » sp » jedit » bsh » 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 » Swing Library » jEdit » org.gjt.sp.jedit.bsh 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.gjt.sp.jedit.bsh.Reflect

Reflect
class Reflect (Code)
All of the reflection API code lies here. It is in the form of static utilities. Maybe this belongs in LHS.java or a generic object wrapper class.




Method Summary
static  ObjectconstructObject(Class clas, Object[] args)
     Primary object constructor This method is simpler than those that must resolve general method invocation because constructors are not inherited.
static  ConstructorfindMostSpecificConstructor(Class[] idealMatch, Constructor[] constructors)
    
static  intfindMostSpecificConstructorIndex(Class[] idealMatch, Constructor[] constructors)
    
static  MethodfindMostSpecificMethod(Class[] idealMatch, Method[] methods)
     Find the best match for signature idealMatch. It is assumed that the methods array holds only valid candidates (e.g.
static  intfindMostSpecificSignature(Class[] idealMatch, Class[][] candidates)
     Implement JLS 15.11.2 Return the index of the most specific arguments match or -1 if no match is found.
public static  ClassgetArrayBaseType(Class arrayClass)
     Returns the base type of an array Class.
public static  intgetArrayDimensions(Class arrayClass)
    
static  Method[]getCandidateMethods(Class baseClass, String methodName, int numArgs, boolean publicOnly)
     Climb the class and interface inheritence graph of the type and collect all methods matching the specified name and criterion.
public static  ObjectgetIndex(Object array, int index)
    
static  LHSgetLHSObjectField(Object object, String fieldName)
     Get an LHS reference to an object field.
static  LHSgetLHSStaticField(Class clas, String fieldName)
    
public static  ObjectgetObjectFieldValue(Object object, String fieldName)
    
public static  ObjectgetObjectProperty(Object obj, String propName)
    
public static  ObjectgetStaticFieldValue(Class clas, String fieldName)
    
public static  booleanhasObjectPropertyGetter(Class clas, String propName)
    
public static  booleanhasObjectPropertySetter(Class clas, String propName)
    
public static  ObjectinvokeCompiledCommand(Class commandClass, Object[] args, Interpreter interpreter, CallStack callstack)
     A command may be implemented as a compiled Java class containing one or more static invoke() methods of the correct signature.
static  ObjectinvokeMethod(Method method, Object object, Object[] args)
     Invoke the Java method on the specified object, performing needed type mappings on arguments and return values.
public static  ObjectinvokeObjectMethod(Object object, String methodName, Object[] args, Interpreter interpreter, CallStack callstack, SimpleNode callerInfo)
     Invoke method on arbitrary object instance.
public static  ObjectinvokeStaticMethod(BshClassManager bcm, Class clas, String methodName, Object[] args)
     Invoke a method known to be static.
public static  StringnormalizeClassName(Class type)
     Return a more human readable version of the type name. Specifically, array types are returned with postfix "[]" dimensions. e.g.
protected static  FieldresolveExpectedJavaField(Class clas, String fieldName, boolean staticOnly)
    
protected static  MethodresolveExpectedJavaMethod(BshClassManager bcm, Class clas, Object object, String name, Object[] args, boolean staticOnly)
     This method wraps resolveJavaMethod() and expects a non-null method result.
protected static  FieldresolveJavaField(Class clas, String fieldName, boolean staticOnly)
    
protected static  MethodresolveJavaMethod(BshClassManager bcm, Class clas, String name, Class[] types, boolean staticOnly)
     The full blown resolver method.
public static  voidsetIndex(Object array, int index, Object val)
    
public static  voidsetObjectProperty(Object obj, String propName, Object value)
    



Method Detail
constructObject
static Object constructObject(Class clas, Object[] args) throws ReflectError, InvocationTargetException(Code)
Primary object constructor This method is simpler than those that must resolve general method invocation because constructors are not inherited.

This method determines whether to attempt to use non-public constructors based on Capabilities.haveAccessibility() and will set the accessibilty flag on the method as necessary.




findMostSpecificConstructor
static Constructor findMostSpecificConstructor(Class[] idealMatch, Constructor[] constructors)(Code)



findMostSpecificConstructorIndex
static int findMostSpecificConstructorIndex(Class[] idealMatch, Constructor[] constructors)(Code)



findMostSpecificMethod
static Method findMostSpecificMethod(Class[] idealMatch, Method[] methods)(Code)
Find the best match for signature idealMatch. It is assumed that the methods array holds only valid candidates (e.g. method name and number of args already matched). This method currently does not take into account Java 5 covariant return types... which I think will require that we find the most derived return type of otherwise identical best matches.
See Also:   Reflect.findMostSpecificSignature(Class[],Class[][])
Parameters:
  methods - the set of candidate method which differ only in thetypes of their arguments.



findMostSpecificSignature
static int findMostSpecificSignature(Class[] idealMatch, Class[][] candidates)(Code)
Implement JLS 15.11.2 Return the index of the most specific arguments match or -1 if no match is found. This method is used by both methods and constructors (which unfortunately don't share a common interface for signature info). the index of the most specific candidate



getArrayBaseType
public static Class getArrayBaseType(Class arrayClass) throws ReflectError(Code)
Returns the base type of an array Class. throws ReflectError if the Class is not an array class.



getArrayDimensions
public static int getArrayDimensions(Class arrayClass)(Code)
returns the dimensionality of the Class returns 0 if the Class is not an array class



getCandidateMethods
static Method[] getCandidateMethods(Class baseClass, String methodName, int numArgs, boolean publicOnly)(Code)
Climb the class and interface inheritence graph of the type and collect all methods matching the specified name and criterion. If publicOnly is true then only public methods in *public* classes or interfaces will be returned. In the normal (non-accessible) case this addresses the problem that arises when a package private class or private inner class implements a public interface or derives from a public type.

This method primarily just delegates to gatherMethodsRecursive()
See Also:   Reflect.gatherMethodsRecursive(Class,String,int,boolean,java.util.Vector)




getIndex
public static Object getIndex(Object array, int index) throws ReflectError, UtilTargetError(Code)



getLHSObjectField
static LHS getLHSObjectField(Object object, String fieldName) throws UtilEvalError, ReflectError(Code)
Get an LHS reference to an object field. This method also deals with the field style property access. In the field does not exist we check for a property setter.



getLHSStaticField
static LHS getLHSStaticField(Class clas, String fieldName) throws UtilEvalError, ReflectError(Code)



getObjectFieldValue
public static Object getObjectFieldValue(Object object, String fieldName) throws UtilEvalError, ReflectError(Code)



getObjectProperty
public static Object getObjectProperty(Object obj, String propName) throws UtilEvalError, ReflectError(Code)



getStaticFieldValue
public static Object getStaticFieldValue(Class clas, String fieldName) throws UtilEvalError, ReflectError(Code)



hasObjectPropertyGetter
public static boolean hasObjectPropertyGetter(Class clas, String propName)(Code)



hasObjectPropertySetter
public static boolean hasObjectPropertySetter(Class clas, String propName)(Code)



invokeCompiledCommand
public static Object invokeCompiledCommand(Class commandClass, Object[] args, Interpreter interpreter, CallStack callstack) throws UtilEvalError(Code)
A command may be implemented as a compiled Java class containing one or more static invoke() methods of the correct signature. The invoke() methods must accept two additional leading arguments of the interpreter and callstack, respectively. e.g. invoke(interpreter, callstack, ... ) This method adds the arguments and invokes the static method, returning the result.



invokeMethod
static Object invokeMethod(Method method, Object object, Object[] args) throws ReflectError, InvocationTargetException(Code)
Invoke the Java method on the specified object, performing needed type mappings on arguments and return values.
Parameters:
  args - may be null



invokeObjectMethod
public static Object invokeObjectMethod(Object object, String methodName, Object[] args, Interpreter interpreter, CallStack callstack, SimpleNode callerInfo) throws ReflectError, EvalError, InvocationTargetException(Code)
Invoke method on arbitrary object instance. invocation may be static (through the object instance) or dynamic. Object may be a bsh scripted object (bsh.This type). the result of the method call



invokeStaticMethod
public static Object invokeStaticMethod(BshClassManager bcm, Class clas, String methodName, Object[] args) throws ReflectError, UtilEvalError, InvocationTargetException(Code)
Invoke a method known to be static. No object instance is needed and there is no possibility of the method being a bsh scripted method.



normalizeClassName
public static String normalizeClassName(Class type)(Code)
Return a more human readable version of the type name. Specifically, array types are returned with postfix "[]" dimensions. e.g. return "int []" for integer array instead of "class [I" as would be returned by Class getName() in that case.



resolveExpectedJavaField
protected static Field resolveExpectedJavaField(Class clas, String fieldName, boolean staticOnly) throws UtilEvalError, ReflectError(Code)

throws:
  ReflectError - if the field is not found.



resolveExpectedJavaMethod
protected static Method resolveExpectedJavaMethod(BshClassManager bcm, Class clas, Object object, String name, Object[] args, boolean staticOnly) throws ReflectError, UtilEvalError(Code)
This method wraps resolveJavaMethod() and expects a non-null method result. If the method is not found it throws a descriptive ReflectError.



resolveJavaField
protected static Field resolveJavaField(Class clas, String fieldName, boolean staticOnly) throws UtilEvalError(Code)



resolveJavaMethod
protected static Method resolveJavaMethod(BshClassManager bcm, Class clas, String name, Class[] types, boolean staticOnly) throws UtilEvalError(Code)
The full blown resolver method. All other method invocation methods delegate to this. The method may be static or dynamic unless staticOnly is set (in which case object may be null). If staticOnly is set then only static methods will be located.

This method performs caching (caches discovered methods through the class manager and utilizes cached methods.)

This method determines whether to attempt to use non-public methods based on Capabilities.haveAccessibility() and will set the accessibilty flag on the method as necessary.

If, when directed to find a static method, this method locates a more specific matching instance method it will throw a descriptive exception analogous to the error that the Java compiler would produce. Note: as of 2.0.x this is a problem because there is no way to work around this with a cast.


Parameters:
  staticOnly - The method located must be static, the object param may be null. the method or null if no matching method was found.




setIndex
public static void setIndex(Object array, int index, Object val) throws ReflectError, UtilTargetError(Code)



setObjectProperty
public static void setObjectProperty(Object obj, String propName, Object value) throws ReflectError, UtilEvalError(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.