public class TestBeanWrapper {
private final Map extendProperties = new HashMap(); //只初始化一次,不能指向另一个引用
private BeanWrapperImpl beanWrapper;
private PropertyDescriptor[] descriptors;
private boolean hasReflected = false;
public static void main(String[] args) {
TestBeanWrapper tb=new TestBeanWrapper();
tb.test();
}
void test(){
BeanWrapperImpl bi=new BeanWrapperImpl(this);
PropertyDescriptor[] alldescriptors=bi.getPropertyDescriptors();
int length=alldescriptors.length;
List list = new ArrayList();
for (int i = 0; i < alldescriptors.length; i++) {
if (alldescriptors[i].getReadMethod() != null
&& alldescriptors[i].getWriteMethod() != null) {
list.add(alldescriptors[i]);
System.out.println(alldescriptors[i].getDisplayName()); //显示这个类的实例属性
}
}
PropertyDescriptor[] descriptors = (PropertyDescriptor[]) list
.toArray(new PropertyDescriptor[0]);
System.out.println(descriptors.length+" list.length="+list.size());
}
public BeanWrapperImpl getBeanWrapper() {
return beanWrapper;
}
public void setBeanWrapper(BeanWrapperImpl beanWrapper) {
this.beanWrapper = beanWrapper;
}
public PropertyDescriptor[] getDescriptors() {
return descriptors;
}
public void setDescriptors(PropertyDescriptor[] descriptors) {
this.descriptors = descriptors;
}
public boolean isHasReflected() {
return hasReflected;
}
public void setHasReflected(boolean hasReflected) {
this.hasReflected = hasReflected;
}
public Map getExtendProperties() {
return extendProperties;
}
}
分享到:
相关推荐
14. <bean class="org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter" /> 15. 16. <!-- 对模型视图名称的解析,即在模型视图名称添加前后缀 --> 17. <bean class="org....
数据表Blob字段在Hibernate持久化映射文件中的type为org.springframework.orm.hibernate3.support.BlobByteArrayType,即Spring所提供的用户自定义的类型,而非java.sql.Blob。 3在Spring中使用org.springframework...
<bean id="sessionFactory" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean"> <!--表示在类路径下加载hibernate.cfg.xml --> <value>classpath:hibernate.cfg.xml ...
spring-beans-4.0.0.RELEASE.jar 所有应用都要用到的,它包含访问配置文件、创建和管理bean spring-context-4.0.0.RELEASE.jar Spring 核心提供了大量扩展 spring-core-4.0.0.RELEASE.jar Spring 框架基本的核心工具...
SpringMybatis Spring / Mybatis多... org.springframework.beans.factory.NoSuchBeanDefinitionException:没有找到类型为[com.proto.net.aron.aronMapper]的合格Bean作为依赖项:至少应有1个有资格作为此依赖
HibernateCallback是一个接口,位于org.springframework.orm.hibernate3中。 该接口中只有一个方法doInHibernate(Session session)。 通常,程序中采用实现HibernateCallback的匿名内部类来获取HibernateCallback的...
aopalliance-1.0.jar, asm-3.3.jar, asm-commons-3.3.jar, asm-tree-3.3.jar, ...validation-api-1.1.0.Final.jar, velocity-1.7.jar, xmlpull-1.1.3.1.jar, xpp3_min-1.1.4c.jar, xstream-1.4.8.jar
log4j-api-2.7.jar,ognl-3.1.12.jar,org.apache.felix.framework-4.0.3.jar,org.apache.felix.main-4.0.3.jar,org.apache.felix.shell-1.4.3.jar,org.apache.felix.shell.tui-1.4.1.jar,org.osgi.compendium-4.0.0....
import org.springframework.beans.factory.InitializingBean; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.jdbc.core.JdbcTemplate; import org.springframework....
一 Jeecms安装过程 将解压后得到的jeecms-...<bean id="freemarkerConfig" class="org.springframework.web.servlet.view.freemarker.FreeMarkerConfigurer"> <property name="freemarkerVariables"> <map> …… ...