阅读背景:

获取未知类的java bean的属性

来源:互联网 

I'd like to be able to call "getProgram" on objects which have that method, without knowing which class they belong to. I know I should use an interface here, but I'm working with someone else's code and can't redesign the classes I'm working with. I thought BeanUtils.getProperty might help me, but it seems it only returns strings. Is there something like Beanutils.getProperty that will return a cast-able object? Or another, smarter way to work with two similar classes that don't share an interface? thanks, -MorganI'd like to be able to call "getProgram" on obj




你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: