Java Doc for ReflectionUtils.java in  » Scripting » bsf-2.4.0 » org » apache » bsf » 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 » Scripting » bsf 2.4.0 » org.apache.bsf.util 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.apache.bsf.util.ReflectionUtils

ReflectionUtils
public class ReflectionUtils (Code)
This file is a collection of reflection utilities. There are utilities for creating beans, getting bean infos, setting/getting properties, and binding events.
author:
   Sanjiva Weerawarana
author:
   Joseph Kesselman




Method Summary
public static  voidaddEventListener(Object source, String eventSetName, EventProcessor processor)
     Add an event processor as a listener to some event coming out of an object.
public static  BeancreateBean(ClassLoader cld, String className, Class[] argTypes, Object[] args)
     Create a bean using given class loader and using the appropriate constructor for the given args of the given arg types.
Parameters:
  cld - the class loader to use.
public static  BeancreateBean(ClassLoader cld, String className, Object[] args)
     Create a bean using given class loader and using the appropriate constructor for the given args.
public static  BeangetField(Object target, String fieldName)
    
public static  BeangetProperty(Object target, String propName, Integer index)
     Get a property of a bean.
public static  voidsetField(Object target, String fieldName, Bean value, TypeConvertorRegistry tcr)
    
public static  voidsetProperty(Object target, String propName, Integer index, Object value, Class valueType, TypeConvertorRegistry tcr)
     Set a property of a bean to a given value.



Method Detail
addEventListener
public static void addEventListener(Object source, String eventSetName, EventProcessor processor) throws IntrospectionException, IllegalArgumentException, IllegalAccessException, InstantiationException, InvocationTargetException(Code)
Add an event processor as a listener to some event coming out of an object.
Parameters:
  source - event source
Parameters:
  eventSetName - name of event set from event src to bind to
Parameters:
  processor - event processor the event should be delegated towhen it occurs; either via processEvent orprocessExceptionableEvent.
exception:
  IntrospectionException - if unable to introspect
exception:
  IllegalArgumentException - if event set is unknown
exception:
  IllegalAccessException - if the event adapter class orinitializer is not accessible.
exception:
  InstantiationException - if event adapter instantiation fails
exception:
  InvocationTargetException - if something goes wrong whilerunning add event listener method



createBean
public static Bean createBean(ClassLoader cld, String className, Class[] argTypes, Object[] args) throws ClassNotFoundException, NoSuchMethodException, InstantiationException, IllegalAccessException, IllegalArgumentException, InvocationTargetException, IOException(Code)
Create a bean using given class loader and using the appropriate constructor for the given args of the given arg types.
Parameters:
  cld - the class loader to use. If null, Class.forName is used.
Parameters:
  className - name of class to instantiate
Parameters:
  argTypes - array of argument types
Parameters:
  args - array of arguments the newly created bean
exception:
  ClassNotFoundException - if class is not loaded
exception:
  NoSuchMethodException - if constructor can't be found
exception:
  InstantiationException - if class can't be instantiated
exception:
  IllegalAccessException - if class is not accessible
exception:
  IllegalArgumentException - if argument problem
exception:
  InvocationTargetException - if constructor excepted
exception:
  IOException - if I/O error in beans.instantiate



createBean
public static Bean createBean(ClassLoader cld, String className, Object[] args) throws ClassNotFoundException, NoSuchMethodException, InstantiationException, IllegalAccessException, IllegalArgumentException, InvocationTargetException, IOException(Code)
Create a bean using given class loader and using the appropriate constructor for the given args. Figures out the arg types and calls above.
Parameters:
  cld - the class loader to use. If null, Class.forName is used.
Parameters:
  className - name of class to instantiate
Parameters:
  args - array of arguments the newly created bean
exception:
  ClassNotFoundException - if class is not loaded
exception:
  NoSuchMethodException - if constructor can't be found
exception:
  InstantiationException - if class can't be instantiated
exception:
  IllegalAccessException - if class is not accessible
exception:
  IllegalArgumentException - if argument problem
exception:
  InvocationTargetException - if constructor excepted
exception:
  IOException - if I/O error in beans.instantiate



getField
public static Bean getField(Object target, String fieldName) throws IllegalArgumentException, IllegalAccessException(Code)



getProperty
public static Bean getProperty(Object target, String propName, Integer index) throws IntrospectionException, IllegalArgumentException, IllegalAccessException, InvocationTargetException(Code)
Get a property of a bean.
Parameters:
  target - the object whose prop is to be gotten
Parameters:
  propName - name of the property to set
Parameters:
  index - index to get (if property is indexed)
exception:
  IntrospectionException - if unable to introspect
exception:
  IllegalArgumentException - if problems with args: if theproperty is unknown, or if the property is given an indexwhen its not, or if the property is not writeable, or ifthe given value cannot be assigned to the it (type mismatch).
exception:
  IllegalAccessException - if read method is not accessible
exception:
  InvocationTargetException - if read method excepts



setField
public static void setField(Object target, String fieldName, Bean value, TypeConvertorRegistry tcr) throws IllegalArgumentException, IllegalAccessException(Code)



setProperty
public static void setProperty(Object target, String propName, Integer index, Object value, Class valueType, TypeConvertorRegistry tcr) throws IntrospectionException, IllegalArgumentException, IllegalAccessException, InvocationTargetException(Code)
Set a property of a bean to a given value.
Parameters:
  target - the object whose prop is to be set
Parameters:
  propName - name of the property to set
Parameters:
  index - index to set (if property is indexed)
Parameters:
  value - the property value
Parameters:
  valueType - the type of the above (needed when its null)
Parameters:
  tcr - type convertor registry to use to convert value type toproperty type if necessary
exception:
  IntrospectionException - if unable to introspect
exception:
  IllegalArgumentException - if problems with args: if theproperty is unknown, or if the property is given an indexwhen its not, or if the property is not writeable, or ifthe given value cannot be assigned to the it (type mismatch).
exception:
  IllegalAccessException - if write method is not accessible
exception:
  InvocationTargetException - if write method excepts



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.