Java Doc for WrapDynaClass.java in  » Library » Apache-commons-beanutils-1.8.0-BETA-src » org » apache » commons » beanutils » 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 » Library » Apache commons beanutils 1.8.0 BETA src » org.apache.commons.beanutils 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.apache.commons.beanutils.WrapDynaClass

WrapDynaClass
public class WrapDynaClass implements DynaClass(Code)

Implementation of DynaClass for DynaBeans that wrap standard JavaBean instances.

It is suggested that this class should not usually need to be used directly to create new WrapDynaBean instances. It's usually better to call the WrapDynaBean constructor directly. For example:

 Object javaBean = ...;
 DynaBean wrapper = new WrapDynaBean(javaBean);
 


author:
   Craig McClanahan
version:
   $Revision: 556229 $ $Date: 2007-07-14 07:11:19 +0100 (Sat, 14 Jul 2007) $



Field Summary
protected  ClassbeanClass
     The JavaBean Class which is represented by this WrapDynaClass.
protected  PropertyDescriptor[]descriptors
     The set of PropertyDescriptors for this bean class.
protected  HashMapdescriptorsMap
     The set of PropertyDescriptors for this bean class, keyed by the property name.
protected static  HashMapdynaClasses
     The set of WrapDynaClass instances that have ever been created, keyed by the underlying bean Class.
protected  DynaProperty[]properties
     The set of dynamic properties that are part of this DynaClass.
protected  HashMappropertiesMap
     The set of dynamic properties that are part of this DynaClass, keyed by the property name.


Method Summary
public static  voidclear()
     Clear our cache of WrapDynaClass instances.
public static  WrapDynaClasscreateDynaClass(Class beanClass)
     Create (if necessary) and return a new WrapDynaClass instance for the specified bean class.
public  DynaProperty[]getDynaProperties()
    

Return an array of ProperyDescriptors for the properties currently defined in this DynaClass.

public  DynaPropertygetDynaProperty(String name)
     Return a property descriptor for the specified property, if it exists; otherwise, return null.
public  StringgetName()
     Return the name of this DynaClass (analogous to the getName() method of java.lang.ClassDynaClass implementation class to support different dynamic classes, with different sets of properties.
public  PropertyDescriptorgetPropertyDescriptor(String name)
     Return the PropertyDescriptor for the specified property name, if any; otherwise return null.
protected  voidintrospect()
     Introspect our bean class to identify the supported properties.
public  DynaBeannewInstance()
    

Instantiates a new standard JavaBean instance associated with this DynaClass and return it wrapped in a new WrapDynaBean instance.


Field Detail
beanClass
protected Class beanClass(Code)
The JavaBean Class which is represented by this WrapDynaClass.



descriptors
protected PropertyDescriptor[] descriptors(Code)
The set of PropertyDescriptors for this bean class.



descriptorsMap
protected HashMap descriptorsMap(Code)
The set of PropertyDescriptors for this bean class, keyed by the property name. Individual descriptor instances will be the same instances as those in the descriptors list.



dynaClasses
protected static HashMap dynaClasses(Code)
The set of WrapDynaClass instances that have ever been created, keyed by the underlying bean Class. The keys to this map are Class objects, and the values are corresponding WrapDynaClass objects.

This static variable is safe even when this code is deployed via a shared classloader because it is keyed via a Class object. The same class loaded via two different classloaders will result in different entries in this map.

Note, however, that this HashMap can result in a memory leak. When this class is in a shared classloader it will retain references to classes loaded via a webapp classloader even after the webapp has been undeployed. That will prevent the entire classloader and all the classes it refers to and all their static members from being freed. !!!!!!!!!!!! PLEASE NOTE !!!!!!!!!!!! ************* THE FOLLOWING IS A NASTY HACK TO SO THAT BEANUTILS REMAINS BINARY COMPATIBLE WITH PREVIOUS RELEASES. There are two issues here: 1) Memory Issues: The static HashMap caused memory problems (See BEANUTILS-59) to resolve this it has been moved into a ContextClassLoaderLocal instance (named CLASSLOADER_CACHE above) which holds one copy per ClassLoader in a WeakHashMap. 2) Binary Compatibility: As the "dynaClasses" static HashMap is "protected" removing it breaks BeanUtils binary compatibility with previous versions. To resolve this all the methods have been overriden to delegate to the Map for the ClassLoader in the ContextClassLoaderLocal.




properties
protected DynaProperty[] properties(Code)
The set of dynamic properties that are part of this DynaClass.



propertiesMap
protected HashMap propertiesMap(Code)
The set of dynamic properties that are part of this DynaClass, keyed by the property name. Individual descriptor instances will be the same instances as those in the properties list.





Method Detail
clear
public static void clear()(Code)
Clear our cache of WrapDynaClass instances.



createDynaClass
public static WrapDynaClass createDynaClass(Class beanClass)(Code)
Create (if necessary) and return a new WrapDynaClass instance for the specified bean class.
Parameters:
  beanClass - Bean class for which a WrapDynaClass is requested A new Wrap DynaClass



getDynaProperties
public DynaProperty[] getDynaProperties()(Code)

Return an array of ProperyDescriptors for the properties currently defined in this DynaClass. If no properties are defined, a zero-length array will be returned.

FIXME - Should we really be implementing getBeanInfo() instead, which returns property descriptors and a bunch of other stuff?

the set of properties for this DynaClass



getDynaProperty
public DynaProperty getDynaProperty(String name)(Code)
Return a property descriptor for the specified property, if it exists; otherwise, return null.
Parameters:
  name - Name of the dynamic property for which a descriptoris requested The descriptor for the specified property
exception:
  IllegalArgumentException - if no property name is specified



getName
public String getName()(Code)
Return the name of this DynaClass (analogous to the getName() method of java.lang.ClassDynaClass implementation class to support different dynamic classes, with different sets of properties. the name of the DynaClass



getPropertyDescriptor
public PropertyDescriptor getPropertyDescriptor(String name)(Code)
Return the PropertyDescriptor for the specified property name, if any; otherwise return null.
Parameters:
  name - Name of the property to be retrieved The descriptor for the specified property



introspect
protected void introspect()(Code)
Introspect our bean class to identify the supported properties.



newInstance
public DynaBean newInstance() throws IllegalAccessException, InstantiationException(Code)

Instantiates a new standard JavaBean instance associated with this DynaClass and return it wrapped in a new WrapDynaBean instance. NOTE the JavaBean should have a no argument constructor.

NOTE - Most common use cases should not need to use this method. It is usually better to create new WrapDynaBean instances by calling its constructor. For example:

 Object javaBean = ...;
 DynaBean wrapper = new WrapDynaBean(javaBean);
 

(This method is needed for some kinds of DynaBean framework.)

A new DynaBean instance
exception:
  IllegalAccessException - if the Class or the appropriateconstructor is not accessible
exception:
  InstantiationException - if this Class represents an abstractclass, an array class, a primitive type, or void; or if instantiationfails for some other reason



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.