angie_hawk7 发表于 2013-1-15 02:23:46

JavaBeans PropertyEditor

主要是学习了解spring如何利用PropertyEditor完成conversion的。参考实现来自网络和spring reference

Spring uses the concept of PropertyEditors to effect the conversion between an Object and a String.

Spring has a number of built-in PropertyEditors to make life easy. Each of those is listed below and they are all located in the org.springframework.beans.propertyeditors package. Most,but not all (as indicated below), are registered by default by BeanWrapperImpl. Where the property editor is configurable in some fashion, you can of course still register your own variant to override the default one:

Spring uses the java.beans.PropertyEditorManager to set the search path for property editors that might be needed

Registering additional custom PropertyEditors
When setting bean properties as a string value, a Spring IoC container ultimately uses standard JavaBeans PropertyEditors to convert these Strings to the complex type of the property
<div class="quote_title">引用
页: [1]
查看完整版本: JavaBeans PropertyEditor