Java Doc for BeanWrapperImpl.java in  » J2EE » spring-framework-2.0.6 » org » springframework » beans » 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 » J2EE » spring framework 2.0.6 » org.springframework.beans 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.springframework.beans.PropertyEditorRegistrySupport
      org.springframework.beans.AbstractPropertyAccessor
         org.springframework.beans.BeanWrapperImpl

BeanWrapperImpl
public class BeanWrapperImpl extends AbstractPropertyAccessor implements BeanWrapper(Code)
Default BeanWrapper implementation that should be sufficient for all typical use cases. Caches introspection results for efficiency.

Note: Auto-registers default property editors from the org.springframework.beans.propertyeditors package, which apply in addition to the JDK's standard PropertyEditors. Applications can call the BeanWrapperImpl.registerCustomEditor(Class,java.beans.PropertyEditor) method to register an editor for a particular instance (i.e. they are not shared across the application). See the base class PropertyEditorRegistrySupport for details.

BeanWrapperImpl will convert collection and array values to the corresponding target collections or arrays, if necessary. Custom property editors that deal with collections or arrays can either be written via PropertyEditor's setValue, or against a comma-delimited String via setAsText, as String arrays are converted in such a format if the array itself is not assignable.
author:
   Rod Johnson
author:
   Juergen Hoeller
author:
   Rob Harrop
since:
   15 April 2001
See Also:   BeanWrapperImpl.registerCustomEditor
See Also:   BeanWrapperImpl.setPropertyValues
See Also:   BeanWrapperImpl.setPropertyValue
See Also:   BeanWrapperImpl.getPropertyValue
See Also:   BeanWrapperImpl.getPropertyType
See Also:   BeanWrapper
See Also:   PropertyEditorRegistrySupport




Constructor Summary
public  BeanWrapperImpl()
     Create new empty BeanWrapperImpl.
public  BeanWrapperImpl(boolean registerDefaultEditors)
     Create new empty BeanWrapperImpl.
public  BeanWrapperImpl(Object object)
     Create new BeanWrapperImpl for the given object.
public  BeanWrapperImpl(Class clazz)
     Create new BeanWrapperImpl, wrapping a new instance of the specified class.
public  BeanWrapperImpl(Object object, String nestedPath, Object rootObject)
     Create new BeanWrapperImpl for the given object, registering a nested path that the object is in.

Method Summary
public  ObjectconvertForProperty(Object value, String propertyName)
     Convert the given value for the specified property to the latter's type.
public  ObjectconvertIfNecessary(Object value, Class requiredType)
    
public  ObjectconvertIfNecessary(Object value, Class requiredType, MethodParameter methodParam)
    
public  ObjectdoTypeConversionIfNecessary(Object value, Class requiredType)
    
protected  BeanWrapperImplgetBeanWrapperForPropertyPath(String propertyPath)
     Recursively navigate to return a BeanWrapper for the nested property path.
final public  StringgetNestedPath()
     Return the nested path of the object wrapped by this BeanWrapper.
public  PropertyDescriptorgetPropertyDescriptor(String propertyName)
    
protected  PropertyDescriptorgetPropertyDescriptorInternal(String propertyName)
     Internal version of BeanWrapperImpl.getPropertyDescriptor : Returns null if not found rather than throwing an exception.
public  PropertyDescriptor[]getPropertyDescriptors()
    
public  ClassgetPropertyType(String propertyName)
    
public  ObjectgetPropertyValue(String propertyName)
    
final public  ClassgetRootClass()
     Return the class of the root object at the top of the path of this BeanWrapper.
final public  ObjectgetRootInstance()
     Return the root object at the top of the path of this BeanWrapper.
final public  ClassgetWrappedClass()
    
final public  ObjectgetWrappedInstance()
    
public  booleanisReadableProperty(String propertyName)
    
public  booleanisWritableProperty(String propertyName)
    
protected  BeanWrapperImplnewNestedBeanWrapper(Object object, String nestedPath)
     Create a new nested BeanWrapper instance.
protected  voidsetIntrospectionClass(Class clazz)
     Set the class to introspect.
public  voidsetPropertyValue(String propertyName, Object value)
    
public  voidsetPropertyValue(PropertyValue pv)
    
public  voidsetWrappedInstance(Object object)
     Switch the target object, replacing the cached introspection results only if the class of the new object is different to that of the replaced object.
public  voidsetWrappedInstance(Object object, String nestedPath, Object rootObject)
     Switch the target object, replacing the cached introspection results only if the class of the new object is different to that of the replaced object.
public  StringtoString()
    


Constructor Detail
BeanWrapperImpl
public BeanWrapperImpl()(Code)
Create new empty BeanWrapperImpl. Wrapped instance needs to be set afterwards. Registers default editors.
See Also:   BeanWrapperImpl.setWrappedInstance



BeanWrapperImpl
public BeanWrapperImpl(boolean registerDefaultEditors)(Code)
Create new empty BeanWrapperImpl. Wrapped instance needs to be set afterwards.
Parameters:
  registerDefaultEditors - whether to register default editors(can be suppressed if the BeanWrapper won't need any type conversion)
See Also:   BeanWrapperImpl.setWrappedInstance



BeanWrapperImpl
public BeanWrapperImpl(Object object)(Code)
Create new BeanWrapperImpl for the given object.
Parameters:
  object - object wrapped by this BeanWrapper



BeanWrapperImpl
public BeanWrapperImpl(Class clazz)(Code)
Create new BeanWrapperImpl, wrapping a new instance of the specified class.
Parameters:
  clazz - class to instantiate and wrap



BeanWrapperImpl
public BeanWrapperImpl(Object object, String nestedPath, Object rootObject)(Code)
Create new BeanWrapperImpl for the given object, registering a nested path that the object is in.
Parameters:
  object - object wrapped by this BeanWrapper
Parameters:
  nestedPath - the nested path of the object
Parameters:
  rootObject - the root object at the top of the path




Method Detail
convertForProperty
public Object convertForProperty(Object value, String propertyName) throws TypeMismatchException(Code)
Convert the given value for the specified property to the latter's type.

This method is only intended for optimizations in a BeanFactory. Use the convertIfNecessary methods for programmatic conversion.
Parameters:
  value - the value to convert
Parameters:
  propertyName - the target property(note that nested or indexed properties are not supported here) the new value, possibly the result of type conversion
throws:
  TypeMismatchException - if type conversion failed




convertIfNecessary
public Object convertIfNecessary(Object value, Class requiredType) throws TypeMismatchException(Code)



convertIfNecessary
public Object convertIfNecessary(Object value, Class requiredType, MethodParameter methodParam) throws TypeMismatchException(Code)



doTypeConversionIfNecessary
public Object doTypeConversionIfNecessary(Object value, Class requiredType) throws TypeMismatchException(Code)

See Also:   BeanWrapperImpl.convertIfNecessary(Object,Class)



getBeanWrapperForPropertyPath
protected BeanWrapperImpl getBeanWrapperForPropertyPath(String propertyPath)(Code)
Recursively navigate to return a BeanWrapper for the nested property path.
Parameters:
  propertyPath - property property path, which may be nested a BeanWrapper for the target bean



getNestedPath
final public String getNestedPath()(Code)
Return the nested path of the object wrapped by this BeanWrapper.



getPropertyDescriptor
public PropertyDescriptor getPropertyDescriptor(String propertyName) throws BeansException(Code)



getPropertyDescriptorInternal
protected PropertyDescriptor getPropertyDescriptorInternal(String propertyName) throws BeansException(Code)
Internal version of BeanWrapperImpl.getPropertyDescriptor : Returns null if not found rather than throwing an exception.
Parameters:
  propertyName - the property to obtain the descriptor for the property descriptor for the specified property,or null if not found
throws:
  BeansException - in case of introspection failure



getPropertyDescriptors
public PropertyDescriptor[] getPropertyDescriptors()(Code)



getPropertyType
public Class getPropertyType(String propertyName) throws BeansException(Code)



getPropertyValue
public Object getPropertyValue(String propertyName) throws BeansException(Code)



getRootClass
final public Class getRootClass()(Code)
Return the class of the root object at the top of the path of this BeanWrapper.
See Also:   BeanWrapperImpl.getNestedPath



getRootInstance
final public Object getRootInstance()(Code)
Return the root object at the top of the path of this BeanWrapper.
See Also:   BeanWrapperImpl.getNestedPath



getWrappedClass
final public Class getWrappedClass()(Code)



getWrappedInstance
final public Object getWrappedInstance()(Code)



isReadableProperty
public boolean isReadableProperty(String propertyName)(Code)



isWritableProperty
public boolean isWritableProperty(String propertyName)(Code)



newNestedBeanWrapper
protected BeanWrapperImpl newNestedBeanWrapper(Object object, String nestedPath)(Code)
Create a new nested BeanWrapper instance.

Default implementation creates a BeanWrapperImpl instance. Can be overridden in subclasses to create a BeanWrapperImpl subclass.
Parameters:
  object - object wrapped by this BeanWrapper
Parameters:
  nestedPath - the nested path of the object the nested BeanWrapper instance




setIntrospectionClass
protected void setIntrospectionClass(Class clazz)(Code)
Set the class to introspect. Needs to be called when the target object changes.
Parameters:
  clazz - the class to introspect



setPropertyValue
public void setPropertyValue(String propertyName, Object value) throws BeansException(Code)



setPropertyValue
public void setPropertyValue(PropertyValue pv) throws BeansException(Code)



setWrappedInstance
public void setWrappedInstance(Object object)(Code)
Switch the target object, replacing the cached introspection results only if the class of the new object is different to that of the replaced object.
Parameters:
  object - the new target object



setWrappedInstance
public void setWrappedInstance(Object object, String nestedPath, Object rootObject)(Code)
Switch the target object, replacing the cached introspection results only if the class of the new object is different to that of the replaced object.
Parameters:
  object - the new target object
Parameters:
  nestedPath - the nested path of the object
Parameters:
  rootObject - the root object at the top of the path



toString
public String toString()(Code)



Methods inherited from org.springframework.beans.AbstractPropertyAccessor
public Class getPropertyType(String propertyPath)(Code)(Java Doc)
abstract public Object getPropertyValue(String propertyName) throws BeansException(Code)(Java Doc)
public boolean isExtractOldValueForEditor()(Code)(Java Doc)
public void setExtractOldValueForEditor(boolean extractOldValueForEditor)(Code)(Java Doc)
public void setPropertyValue(PropertyValue pv) throws BeansException(Code)(Java Doc)
abstract public void setPropertyValue(String propertyName, Object value) throws BeansException(Code)(Java Doc)
public void setPropertyValues(Map map) throws BeansException(Code)(Java Doc)
public void setPropertyValues(PropertyValues pvs) throws BeansException(Code)(Java Doc)
public void setPropertyValues(PropertyValues pvs, boolean ignoreUnknown) throws BeansException(Code)(Java Doc)
public void setPropertyValues(PropertyValues pvs, boolean ignoreUnknown, boolean ignoreInvalid) throws BeansException(Code)(Java Doc)

Methods inherited from org.springframework.beans.PropertyEditorRegistrySupport
protected void copyCustomEditorsTo(PropertyEditorRegistry target, String nestedProperty)(Code)(Java Doc)
protected void copyDefaultEditorsTo(PropertyEditorRegistrySupport target)(Code)(Java Doc)
public PropertyEditor findCustomEditor(Class requiredType, String propertyPath)(Code)(Java Doc)
protected PropertyEditor getDefaultEditor(Class requiredType)(Code)(Java Doc)
protected Class getPropertyType(String propertyPath)(Code)(Java Doc)
protected Class guessPropertyTypeFromEditors(String propertyName)(Code)(Java Doc)
public boolean hasCustomEditorForElement(Class elementType, String propertyPath)(Code)(Java Doc)
public boolean isSharedEditor(PropertyEditor propertyEditor)(Code)(Java Doc)
public void registerCustomEditor(Class requiredType, PropertyEditor propertyEditor)(Code)(Java Doc)
public void registerCustomEditor(Class requiredType, String propertyPath, PropertyEditor propertyEditor)(Code)(Java Doc)
protected void registerDefaultEditors()(Code)(Java Doc)
public void registerSharedEditor(Class requiredType, PropertyEditor propertyEditor)(Code)(Java Doc)
public void useConfigValueEditors()(Code)(Java Doc)

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.