Java Doc for BeanUtils.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.BeanUtils

All known Subclasses:   org.apache.commons.beanutils.locale.LocaleBeanUtils,
BeanUtils
public class BeanUtils (Code)

Utility methods for populating JavaBeans properties via reflection.

The implementations are provided by BeanUtilsBean . These static utility methods use the default instance. More sophisticated behaviour can be provided by using a BeanUtilsBean instance.


author:
   Craig R. McClanahan
author:
   Ralph Schaer
author:
   Chris Audley
author:
   Rey Francois
author:
   Gregor Rayman
version:
   $Revision: 555824 $ $Date: 2007-07-13 01:27:15 +0100 (Fri, 13 Jul 2007) $
See Also:   BeanUtilsBean




Method Summary
public static  ObjectcloneBean(Object bean)
    
public static  voidcopyProperties(Object dest, Object orig)
    
public static  voidcopyProperty(Object bean, String name, Object value)
    
public static  Mapdescribe(Object bean)
    
public static  String[]getArrayProperty(Object bean, String name)
    
public static  intgetDebug()
    
public static  StringgetIndexedProperty(Object bean, String name)
    
public static  StringgetIndexedProperty(Object bean, String name, int index)
     Return the value of the specified indexed property of the specified bean, as a String.
public static  StringgetMappedProperty(Object bean, String name)
    
public static  StringgetMappedProperty(Object bean, String name, String key)
    
public static  StringgetNestedProperty(Object bean, String name)
    
public static  StringgetProperty(Object bean, String name)
    
public static  StringgetSimpleProperty(Object bean, String name)
    
public static  booleaninitCause(Throwable throwable, Throwable cause)
     If we're running on JDK 1.4 or later, initialize the cause for the given throwable.
Parameters:
  throwable - The throwable.
Parameters:
  cause - The cause of the throwable.
public static  voidpopulate(Object bean, Map properties)
    
public static  voidsetDebug(int newDebug)
    
public static  voidsetProperty(Object bean, String name, Object value)
    



Method Detail
cloneBean
public static Object cloneBean(Object bean) throws IllegalAccessException, InstantiationException, InvocationTargetException, NoSuchMethodException(Code)

Clone a bean based on the available property getters and setters, even if the bean class itself does not implement Cloneable.

For more details see BeanUtilsBean.


Parameters:
  bean - Bean to be cloned the cloned bean
exception:
  IllegalAccessException - if the caller does not haveaccess to the property accessor method
exception:
  InstantiationException - if a new instance of the bean'sclass cannot be instantiated
exception:
  InvocationTargetException - if the property accessor methodthrows an exception
exception:
  NoSuchMethodException - if an accessor method for thisproperty cannot be found
See Also:   BeanUtilsBean.cloneBean



copyProperties
public static void copyProperties(Object dest, Object orig) throws IllegalAccessException, InvocationTargetException(Code)

Copy property values from the origin bean to the destination bean for all cases where the property names are the same.

For more details see BeanUtilsBean.


Parameters:
  dest - Destination bean whose properties are modified
Parameters:
  orig - Origin bean whose properties are retrieved
exception:
  IllegalAccessException - if the caller does not haveaccess to the property accessor method
exception:
  IllegalArgumentException - if the dest ororig argument is null or if the dest property type is different from the source type and the relevantconverter has not been registered.
exception:
  InvocationTargetException - if the property accessor methodthrows an exception
See Also:   BeanUtilsBean.copyProperties



copyProperty
public static void copyProperty(Object bean, String name, Object value) throws IllegalAccessException, InvocationTargetException(Code)

Copy the specified property value to the specified destination bean, performing any type conversion that is required.

For more details see BeanUtilsBean.


Parameters:
  bean - Bean on which setting is to be performed
Parameters:
  name - Property name (can be nested/indexed/mapped/combo)
Parameters:
  value - Value to be set
exception:
  IllegalAccessException - if the caller does not haveaccess to the property accessor method
exception:
  InvocationTargetException - if the property accessor methodthrows an exception
See Also:   BeanUtilsBean.copyProperty
See Also:   



describe
public static Map describe(Object bean) throws IllegalAccessException, InvocationTargetException, NoSuchMethodException(Code)

Return the entire set of properties for which the specified bean provides a read method.

For more details see BeanUtilsBean.


Parameters:
  bean - Bean whose properties are to be extracted Map of property descriptors
exception:
  IllegalAccessException - if the caller does not haveaccess to the property accessor method
exception:
  InvocationTargetException - if the property accessor methodthrows an exception
exception:
  NoSuchMethodException - if an accessor method for thisproperty cannot be found
See Also:   BeanUtilsBean.describe
See Also:   



getArrayProperty
public static String[] getArrayProperty(Object bean, String name) throws IllegalAccessException, InvocationTargetException, NoSuchMethodException(Code)

Return the value of the specified array property of the specified bean, as a String array.

For more details see BeanUtilsBean.


Parameters:
  bean - Bean whose property is to be extracted
Parameters:
  name - Name of the property to be extracted The array property value
exception:
  IllegalAccessException - if the caller does not haveaccess to the property accessor method
exception:
  InvocationTargetException - if the property accessor methodthrows an exception
exception:
  NoSuchMethodException - if an accessor method for thisproperty cannot be found
See Also:   BeanUtilsBean.getArrayProperty
See Also:   



getDebug
public static int getDebug()(Code)
The debug static property is no longer used debug property



getIndexedProperty
public static String getIndexedProperty(Object bean, String name) throws IllegalAccessException, InvocationTargetException, NoSuchMethodException(Code)

Return the value of the specified indexed property of the specified bean, as a String.

For more details see BeanUtilsBean.


Parameters:
  bean - Bean whose property is to be extracted
Parameters:
  name - propertyname[index] of the property valueto be extracted The indexed property's value, converted to a String
exception:
  IllegalAccessException - if the caller does not haveaccess to the property accessor method
exception:
  InvocationTargetException - if the property accessor methodthrows an exception
exception:
  NoSuchMethodException - if an accessor method for thisproperty cannot be found
See Also:   BeanUtilsBean.getIndexedProperty(ObjectString)



getIndexedProperty
public static String getIndexedProperty(Object bean, String name, int index) throws IllegalAccessException, InvocationTargetException, NoSuchMethodException(Code)
Return the value of the specified indexed property of the specified bean, as a String. The index is specified as a method parameter and must *not* be included in the property name expression

For more details see BeanUtilsBean.


Parameters:
  bean - Bean whose property is to be extracted
Parameters:
  name - Simple property name of the property value to be extracted
Parameters:
  index - Index of the property value to be extracted The indexed property's value, converted to a String
exception:
  IllegalAccessException - if the caller does not haveaccess to the property accessor method
exception:
  InvocationTargetException - if the property accessor methodthrows an exception
exception:
  NoSuchMethodException - if an accessor method for thisproperty cannot be found
See Also:   BeanUtilsBean.getIndexedProperty(ObjectStringint)



getMappedProperty
public static String getMappedProperty(Object bean, String name) throws IllegalAccessException, InvocationTargetException, NoSuchMethodException(Code)

Return the value of the specified indexed property of the specified bean, as a String.

For more details see BeanUtilsBean.


Parameters:
  bean - Bean whose property is to be extracted
Parameters:
  name - propertyname(index) of the property valueto be extracted The mapped property's value, converted to a String
exception:
  IllegalAccessException - if the caller does not haveaccess to the property accessor method
exception:
  InvocationTargetException - if the property accessor methodthrows an exception
exception:
  NoSuchMethodException - if an accessor method for thisproperty cannot be found
See Also:   BeanUtilsBean.getMappedProperty(ObjectString)



getMappedProperty
public static String getMappedProperty(Object bean, String name, String key) throws IllegalAccessException, InvocationTargetException, NoSuchMethodException(Code)

Return the value of the specified mapped property of the specified bean, as a String.

For more details see BeanUtilsBean.


Parameters:
  bean - Bean whose property is to be extracted
Parameters:
  name - Simple property name of the property value to be extracted
Parameters:
  key - Lookup key of the property value to be extracted The mapped property's value, converted to a String
exception:
  IllegalAccessException - if the caller does not haveaccess to the property accessor method
exception:
  InvocationTargetException - if the property accessor methodthrows an exception
exception:
  NoSuchMethodException - if an accessor method for thisproperty cannot be found
See Also:   BeanUtilsBean.getMappedProperty(ObjectStringString)



getNestedProperty
public static String getNestedProperty(Object bean, String name) throws IllegalAccessException, InvocationTargetException, NoSuchMethodException(Code)

Return the value of the (possibly nested) property of the specified name, for the specified bean, as a String.

For more details see BeanUtilsBean.


Parameters:
  bean - Bean whose property is to be extracted
Parameters:
  name - Possibly nested name of the property to be extracted The nested property's value, converted to a String
exception:
  IllegalAccessException - if the caller does not haveaccess to the property accessor method
exception:
  IllegalArgumentException - if a nested reference to aproperty returns null
exception:
  InvocationTargetException - if the property accessor methodthrows an exception
exception:
  NoSuchMethodException - if an accessor method for thisproperty cannot be found
See Also:   BeanUtilsBean.getNestedProperty



getProperty
public static String getProperty(Object bean, String name) throws IllegalAccessException, InvocationTargetException, NoSuchMethodException(Code)

Return the value of the specified property of the specified bean, no matter which property reference format is used, as a String.

For more details see BeanUtilsBean.


Parameters:
  bean - Bean whose property is to be extracted
Parameters:
  name - Possibly indexed and/or nested name of the propertyto be extracted The property's value, converted to a String
exception:
  IllegalAccessException - if the caller does not haveaccess to the property accessor method
exception:
  InvocationTargetException - if the property accessor methodthrows an exception
exception:
  NoSuchMethodException - if an accessor method for thisproperty cannot be found
See Also:   BeanUtilsBean.getProperty



getSimpleProperty
public static String getSimpleProperty(Object bean, String name) throws IllegalAccessException, InvocationTargetException, NoSuchMethodException(Code)

Return the value of the specified simple property of the specified bean, converted to a String.

For more details see BeanUtilsBean.


Parameters:
  bean - Bean whose property is to be extracted
Parameters:
  name - Name of the property to be extracted The property's value, converted to a String
exception:
  IllegalAccessException - if the caller does not haveaccess to the property accessor method
exception:
  InvocationTargetException - if the property accessor methodthrows an exception
exception:
  NoSuchMethodException - if an accessor method for thisproperty cannot be found
See Also:   BeanUtilsBean.getSimpleProperty



initCause
public static boolean initCause(Throwable throwable, Throwable cause)(Code)
If we're running on JDK 1.4 or later, initialize the cause for the given throwable.
Parameters:
  throwable - The throwable.
Parameters:
  cause - The cause of the throwable. true if the cause was initialized, otherwise false.



populate
public static void populate(Object bean, Map properties) throws IllegalAccessException, InvocationTargetException(Code)

Populate the JavaBeans properties of the specified bean, based on the specified name/value pairs.

For more details see BeanUtilsBean.


Parameters:
  bean - JavaBean whose properties are being populated
Parameters:
  properties - Map keyed by property name, with thecorresponding (String or String[]) value(s) to be set
exception:
  IllegalAccessException - if the caller does not haveaccess to the property accessor method
exception:
  InvocationTargetException - if the property accessor methodthrows an exception
See Also:   BeanUtilsBean.populate



setDebug
public static void setDebug(int newDebug)(Code)
The debug static property is no longer used
Parameters:
  newDebug - debug property



setProperty
public static void setProperty(Object bean, String name, Object value) throws IllegalAccessException, InvocationTargetException(Code)

Set the specified property value, performing type conversions as required to conform to the type of the destination property.

For more details see BeanUtilsBean.


Parameters:
  bean - Bean on which setting is to be performed
Parameters:
  name - Property name (can be nested/indexed/mapped/combo)
Parameters:
  value - Value to be set
exception:
  IllegalAccessException - if the caller does not haveaccess to the property accessor method
exception:
  InvocationTargetException - if the property accessor methodthrows an exception
See Also:   BeanUtilsBean.setProperty



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.