2016 年 10 月
0 篇文章
使用 beanUtils 控制 javabean 使用 BeanUtils 设置/读取属性的值以及默认支持的自动转化:@Test//使用 BeanUtils 设置/读取属性的值以及自动转化 publicvoidtest1()throwsIllegalAccessException,InvocationTargetException,NoSuchMethodException{Personp=newPerson();/
使用内省(Introspector)操作获取类 bean 中的所有属性:@Test//获取类 bean 中的所有属性 publicvoidtest1()throwsException{BeanInfoinfo=Introspector.getBeanInfo(Person.class);PropertyDescriptor[]decriptors=info.getPropertyDescriptors();f
示例类代码@SuppressWarnings("unused")publicclassPerson{publicStringName;privateintAge;publicGenderGender;privatestaticStringSpecies="人类";publicPerson(){Name="佚名";Age=-1;}publicPerson(Stringname){Name=name;}
使用 Chromium 时会遇到“缺少 googleapi 密钥,因此 chromium 的部分功能将无法使用”提示,google 了一下 setxGoogle_API_KEY 和 chromiumportablegoogleapikeysaremissing 找到了解决办法。打开 windows 的 cmd 命令提示符,依次输入以下命令:setxGOOGLE_API_KEY"no"setxGOOGLE_DEFAULT_CLIE