锘??xml version="1.0" encoding="utf-8" standalone="yes"?>亚洲欧美第一成人网站7777 ,亚洲成AV人片在线观看ww,久久亚洲AV成人无码软件http://m.tkk7.com/lendo/category/20807.htmlzh-cnThu, 05 Apr 2007 03:27:31 GMTThu, 05 Apr 2007 03:27:31 GMT60Spring FrameWork錛峛eans鍖咃紞灞炴х紪杈戝櫒(PropertyEditor)http://m.tkk7.com/lendo/articles/105589.htmllendolendoWed, 04 Apr 2007 04:55:00 GMThttp://m.tkk7.com/lendo/articles/105589.htmlhttp://m.tkk7.com/lendo/comments/105589.htmlhttp://m.tkk7.com/lendo/articles/105589.html#Feedback0http://m.tkk7.com/lendo/comments/commentRss/105589.htmlhttp://m.tkk7.com/lendo/services/trackbacks/105589.html         鏈潵鎯蟲妸beans鍖呮斁鍒頒竴綃囨枃绔犱腑鏉ヨ褰曞緱錛屼笉榪囬殢鐫瀛︿範(fàn)寰楁繁鍏ワ紝鍙戠幇鍘熸潵灝辨槸榪欎竴涓寘錛屼篃鏈夊緢澶氬緱鏈哄埗闇瑕佽緇嗗緱鎻忚堪錛屾墍浠ユ垜榪樻槸鎶婂師鏉ョ殑鏂囨。鎷嗗垎鎴愬嚑涓儴鍒嗭紝榪欐牱鎴戜互鍚巖eview鑷繁瀛︿範(fàn)鐨勬椂鍊欎篃姣旇緝娓呮銆?br>     棣栧厛搴旇璇存槑涓涓嬩粈涔堟槸灞炴х紪杈戝櫒錛屽湪Spring鐨勫簲鐢ㄤ腑緇忓父瑕侀亣鍒拌繖縐嶆儏鍐碉紝JavaBean鐨勫兼槸鍦ㄨ繍琛岀殑鏃跺欏姩鎬佸湴浠庨厤緗枃浠朵腑娉ㄥ叆鐨勶紝鑰岄厤緗枃浠朵腑灞炴х殑鍊奸兘鏄疭tring綾誨瀷鐨勶紝瀵瑰簲鐨凧avaBean涓嵈鏈夊叾浠栧緢澶氱被鍨嬶紝濡侱ate,Integer,Byte絳夛紝鎵浠ュ睘鎬х紪杈戝櫒鐨勪換鍔″氨鏄湪Spring榪涜娉ㄥ叆榪欎釜鍔ㄤ綔鐨勬椂鍊欙紝灝哠tring綾誨瀷鐨勬暟鎹漿鍖栦負(fù)JavaBean瀵瑰簲鐨勭被鍨嬨?br>     姣斿濡備笅榪欐浠g爜錛孶serBean鏄竴涓爣鍑嗙殑JavaBean錛屾湁Integer id鍜孲tring userName涓や釜灞炴с?br>    
     public class TestBeanWrapper extends TestCase {
         public void testPropertyEditor() throws Exception{
             Object obj = Class.forName("com.ws.po.UserBean").newInstance();
             BeanWrapper bw = new BeanWrapperImpl(obj);錛圓錛?/榪欓噷灝辮鍋氭敞鍐屽睘鎬х紪杈戝櫒鐨勫伐浣?br>             bw.setPropertyValue("id", "1");錛圔錛?br>             System.out.println(bw.getPropertyValue("id").getClass());錛圕錛?br>         }
    
}

     鍦ㄤ唬鐮丄榪欓噷錛屽氨闇瑕佹敞鍐屽睘鎬х紪杈戝櫒錛屼篃鏄疭pring Ioc鏈哄埗鐨勫叧閿儴鍒嗐?br>     鍦ㄤ唬鐮丅榪欓噷錛屾垜騫舵病鏈変紶鍏ew Integer(1)錛岃屾槸鐩存帴浼犲叆浜嗕竴涓瓧絎︿覆“1”銆?br>     鍦ㄤ唬鐮丆榪欓噷錛屽氨寰楀埌浜嗘垜鎯寵鐨勭被鍨嬶紝杈撳嚭緇撴灉涓猴細(xì)class java.lang.Integer銆?br>     濡傛灉浣犺瘯鍥懼湪B浠g爜榪欓噷錛屽皢“1”鏇存崲涓?#8220;SSSS”瀛楃涓詫紝閭d箞浼?xì)寰楀堫C竴涓猅ypeMismatchException錛屾彁紺烘棤娉曡漿鎹€?/font>

     閭d箞鍦ㄤ唬鐮丄榪欓噷鍒板簳鍙戠敓浜嗕簺浠涔堝憿(鍙拡瀵瑰睘鎬х紪杈戝櫒鏉ヨ)錛熶笅闈竴灞傚眰鍦板線閲岄潰璧般?br>    榪欐浠g爜閲岄潰娌℃湁浠諱綍鐨勬湁鍏沖睘鎬х紪杈戝櫒鐨勪唬鐮侊紝閭d箞灝卞彧鏈夊線BeanWrapperImpl閲岄潰鏌ユ壘銆?br>
     public BeanWrapperImpl(Object object) {
         registerDefaultEditors();//榪欓噷灝卞紑濮嬫敞鍐岄粯璁ょ殑灞炴х紪杈戝櫒浜?br>         setWrappedInstance(object);
     }
 

     
BeanWrapperImpl綾葷戶鎵胯嚜AbstractPropertyAccessor鎶借薄綾伙紝AbstractPropertyAccessor綾誨張緇ф壙鑷狿ropertyEditorRegistrySupport綾伙紝鍦≒ropertyEditorRegistrySupport涓氨瀹炵幇浜唕egisterDefaultEditors()榪欎釜鏂規(guī)硶錛屼唬鐮佸涓嬶細(xì)

     protected void registerDefaultEditors() {
         this.defaultEditors = new HashMap(32);

         // Simple editors, without parameterization capabilities.
         // The JDK does not contain a default editor for any of these target types.
         this.defaultEditors.put(Class.class, new ClassEditor());
         this.defaultEditors.put(Class[].class, new ClassArrayEditor());
         this.defaultEditors.put(File.class, new FileEditor());
         this.defaultEditors.put(InputStream.class, new InputStreamEditor());
         this.defaultEditors.put(Locale.class, new LocaleEditor());
         this.defaultEditors.put(Properties.class, new PropertiesEditor());
         this.defaultEditors.put(Resource[].class, new ResourceArrayPropertyEditor());
         this.defaultEditors.put(URL.class, new URLEditor());

         // Register JDK-1.4-specific editors.
         if (JdkVersion.isAtLeastJava14()) {
             this.defaultEditors.put(URI.class, new URIEditor());
             this.defaultEditors.put(Pattern.class, new PatternEditor());
         }

         // Default instances of collection editors.
         // Can be overridden by registering custom instances of those as custom editors.
         this.defaultEditors.put(Collection.class, new CustomCollectionEditor(Collection.class));
         this.defaultEditors.put(Set.class, new CustomCollectionEditor(Set.class));
         this.defaultEditors.put(SortedSet.class, new CustomCollectionEditor(SortedSet.class));
         this.defaultEditors.put(List.class, new CustomCollectionEditor(List.class));
         this.defaultEditors.put(SortedMap.class, new CustomMapEditor(SortedMap.class));

         // Default editors for primitive arrays.
         this.defaultEditors.put(byte[].class, new ByteArrayPropertyEditor());
         this.defaultEditors.put(char[].class, new CharArrayPropertyEditor());

         // The JDK does not contain a default editor for char!
         this.defaultEditors.put(char.class, new CharacterEditor(false));
         this.defaultEditors.put(Character.class, new CharacterEditor(true));

         // Spring's CustomBooleanEditor accepts more flag values than the JDK's default editor.
         this.defaultEditors.put(boolean.class, new CustomBooleanEditor(false));
         this.defaultEditors.put(Boolean.class, new CustomBooleanEditor(true));

         // The JDK does not contain default editors for number wrapper types!
         // Override JDK primitive number editors with our own CustomNumberEditor.
         this.defaultEditors.put(byte.class, new CustomNumberEditor(Byte.class, false));
         this.defaultEditors.put(Byte.class, new CustomNumberEditor(Byte.class, true));
         this.defaultEditors.put(short.class, new CustomNumberEditor(Short.class, false));
         this.defaultEditors.put(Short.class, new CustomNumberEditor(Short.class, true));
         this.defaultEditors.put(int.class, new CustomNumberEditor(Integer.class, false));
         this.defaultEditors.put(Integer.class, new CustomNumberEditor(Integer.class, true));
         this.defaultEditors.put(long.class, new CustomNumberEditor(Long.class, false));
         this.defaultEditors.put(Long.class, new CustomNumberEditor(Long.class, true));
         this.defaultEditors.put(float.class, new CustomNumberEditor(Float.class, false));
         this.defaultEditors.put(Float.class, new CustomNumberEditor(Float.class, true));
         this.defaultEditors.put(double.class, new CustomNumberEditor(Double.class, false));
         this.defaultEditors.put(Double.class, new CustomNumberEditor(Double.class, true));
         this.defaultEditors.put(BigDecimal.class, new CustomNumberEditor(BigDecimal.class, true));
         this.defaultEditors.put(BigInteger.class, new CustomNumberEditor(BigInteger.class, true));
    }



lendo 2007-04-04 12:55 鍙戣〃璇勮
]]>
主站蜘蛛池模板: 无码一区二区三区亚洲人妻| www.999精品视频观看免费| 亚洲熟妇av午夜无码不卡| 亚洲日本va中文字幕久久| 国产一级理论免费版| 久久久久久99av无码免费网站| 亚洲国产成人精品电影| 精品无码无人网站免费视频| 女人张开腿给人桶免费视频| 日本亚洲欧洲免费天堂午夜看片女人员| 亚洲国产精品日韩av不卡在线| 亚洲国产综合专区在线电影| 俄罗斯极品美女毛片免费播放| 国产va免费精品观看精品| 无码国产精品一区二区免费式芒果| 美女视频黄a视频全免费网站一区| 亚洲一区动漫卡通在线播放| 亚洲男人的天堂在线播放| 中文字幕亚洲无线码a| 亚洲国产成人久久一区WWW| 免费无码又爽又刺激高潮的视频| 69精品免费视频| 伊人久久免费视频| 日本中文字幕免费高清视频| 中文字幕免费播放| 黄色视频在线免费观看| 一级**爱片免费视频| 黄色a级片免费看| 免费看一级高潮毛片| 亚洲a∨无码一区二区| 亚洲日本中文字幕天天更新| 亚洲中文字幕无码爆乳| 亚洲福利秒拍一区二区| 亚洲伊人久久精品| 国产亚洲sss在线播放| 亚洲码和欧洲码一码二码三码| 亚洲国产激情在线一区| 亚洲精品成a人在线观看夫| 亚洲国产高清国产拍精品| 亚洲AV噜噜一区二区三区| 免费播放美女一级毛片|