Commons Collections僥楼永芝?膨? - 園殻秘壇利
作者 佚名技术
来源 NET编程
浏览
发布时间 2012-06-16
riteMethod( name ); if ( method == null ) { throw new IllegalArgumentException( "The bean of type: "+ bean.getClass().getName() + " has no property called: " + name ); } try { Object[] arguments = createWriteMethodArguments( method, value );//廬算歌方 method.invoke( bean, arguments );//譜崔仟峙 Object newValue = get( name );//資函仟譜崔議峙 firePropertyChange( name, oldValue, newValue );//fire奉來峙個延並周 } catch ( InvocationTargetException e ) { logInfo( e ); throw new IllegalArgumentException( e.getMessage() ); } catch ( IllegalAccessException e ) { logInfo( e ); throw new IllegalArgumentException( e.getMessage() ); } return oldValue; } return null; } public Method getReadMethod(String name) {//資函峺協兆各奉來議getXXX圭隈 return (Method) readMethods.get(name); } public Method getWriteMethod(String name) {//資函峺協兆各奉來議setXXX圭隈 return (Method) writeMethods.get(name); } private void initialise() { if(getBean() == null) return; Class beanClass = getBean().getClass();//bean議Class try { //BeanInfo beanInfo = Introspector.getBeanInfo( bean, null ); BeanInfo beanInfo = Introspector.getBeanInfo( beanClass );//bean議佚連 PropertyDescriptor[] propertyDescriptors = beanInfo.getPropertyDescriptors(); if ( propertyDescriptors != null ) { for ( int i = 0; i < propertyDescriptors.length; i++ ) { PropertyDescriptor propertyDescriptor = propertyDescriptors[i]; if ( propertyDescriptor != null ) { String name = propertyDescriptor.getName();//奉來兆各 Method readMethod = propertyDescriptor.getReadMethod();//getXXX圭隈 Method writeMethod = propertyDescriptor.getWriteMethod();//setXXX圭隈 Class aType = propertyDescriptor.getPropertyType();//奉來窃侏 if ( readMethod != null ) { readMethods.put( name, readMethod );//隠贋欺getXXX鹿栽 } if ( writeMethod != null ) { writeMethods.put( name, writeMethod );//隠贋欺setXXX鹿栽 } types.put( name, aType );//隠贋奉來窃侏 } } } } catch ( IntrospectionException e ) { logWarn( e ); } } protected static class MyMapEntry extends AbstractMapEntry {//BeanMap聞喘議Map entry |
凌众科技专业提供服务器租用、服务器托管、企业邮局、虚拟主机等服务,公司网站:http://www.lingzhong.cn 为了给广大客户了解更多的技术信息,本技术文章收集来源于网络,凌众科技尊重文章作者的版权,如果有涉及你的版权有必要删除你的文章,请和我们联系。以上信息与文章正文是不可分割的一部分,如果您要转载本文章,请保留以上信息,谢谢! |
你可能对下面的文章感兴趣
关于Commons Collections僥楼永芝?膨? - 園殻秘壇利的所有评论