RE: [ot] utility to verify if an Object implements all methods from Interface?

2005-11-08 Thread Mick Knutson
No, I am using the BeanUtils.copyProperties(target, orig); -Original Message- From: Dave Newton [mailto:[EMAIL PROTECTED] Sent: Friday, October 28, 2005 12:57 PM To: Struts Users Mailing List Subject: Re: [ot] utility to verify if an Object implements all methods from Interface? Mick

Re: [ot] utility to verify if an Object implements all methods from Interface?

2005-10-28 Thread Dave Newton
Frank W. Zammetti wrote: Hey, this is 2005, almost 2006, any solution must have: * At least 50 EJBs * Be based on some framework that can't be comprehended without $10,000 worth of development tools * A completely superfluous persistence framework * At least 25 XML config files * 75 UML diagr

Re: [ot] utility to verify if an Object implements all methods from Interface?

2005-10-28 Thread Frank W. Zammetti
Hey, this is 2005, almost 2006, any solution must have: * At least 50 EJBs * Be based on some framework that can't be comprehended without $10,000 worth of development tools * A completely superfluous persistence framework * At least 25 XML config files * 75 UML diagrams * A document talking ab

Re: [ot] utility to verify if an Object implements all methods from Interface?

2005-10-28 Thread Dave Newton
Frank W. Zammetti wrote: Yeah, I don't know why I thought there was more to it 20 minutes ago, that looks right to me too now. Oh, come on. There's gotta me an XML config file in there SOMEWHERE! Dave - To unsubscribe,

Re: [ot] utility to verify if an Object implements all methods from Interface?

2005-10-28 Thread Frank W. Zammetti
Yeah, I don't know why I thought there was more to it 20 minutes ago, that looks right to me too now. -- Frank W. Zammetti Founder and Chief Software Architect Omnytex Technologies http://www.omnytex.com AIM: fzammetti Yahoo: fzammetti MSN: [EMAIL PROTECTED] On Fri, October 28, 2005 4:13 pm, Ric

Re: [ot] utility to verify if an Object implements all methods from Interface?

2005-10-28 Thread Richard Yee
I think the subclassing suggestion is the easiest. public class subclass extends superclass implements theInterface { // empty class declaration } -Richard --- "Frank W. Zammetti" <[EMAIL PROTECTED]> wrote: > It's funny, I started writing up an example with a > subclass and an > implemente

Re: [ot] utility to verify if an Object implements all methods from Interface?

2005-10-28 Thread Frank W. Zammetti
It's funny, I started writing up an example with a subclass and an implemented interface and cloning and so on and so forth and as I got near the end I said "wait, this is stupid, just loop through with reflection as I and others suggested yesterday!"... Sometimes the "brute force" method really *i

Re: [ot] utility to verify if an Object implements all methods from Interface?

2005-10-28 Thread Dave Newton
Mick Knutson wrote: Because I would have to modify generated code to do that. And it only implements serializable. Nothing else. And you can't subclass it and have the subclass implement the interface? In any case, just loop through w/ reflection and check. I'm still confused though; are

RE: [ot] utility to verify if an Object implements all methods from Interface?

2005-10-28 Thread Mick Knutson
an Object implements all methods from Interface? Interesting... why can't you implement the interface? Just curious. Does it implement any other interfaces to build up the method list? If so, you could just do a serious of instanceof's against all the interfaces it implements. Alt

Re: [ot] utility to verify if an Object implements all methods from Interface?

2005-10-28 Thread Richard Yee
Mick, You could write a wrapper object that wraps (extends) the generated object and implements the interface. If the extended object does not have all of the methods defined in the interface, you will get a compile error. -Richard --- Mick Knutson <[EMAIL PROTECTED]> wrote: > I have some genera

Re: [ot] utility to verify if an Object implements all methods from Interface?

2005-10-27 Thread David Evans
I think you could use the java.lang.reflect package classes: Object obj = new Object(); Method[] methods = obj.getClass.getMethods(); Create another test object that does implement all of the interfaces, and then compare the methods array to the array created by the test object's .getClass.getMet

Re: [ot] utility to verify if an Object implements all methods from Interface?

2005-10-27 Thread Frank W. Zammetti
Interesting... why can't you implement the interface? Just curious. Does it implement any other interfaces to build up the method list? If so, you could just do a serious of instanceof's against all the interfaces it implements. Alternatively, you can use reflection to get a list of the met

[ot] utility to verify if an Object implements all methods from Interface?

2005-10-27 Thread Mick Knutson
I have some generated Objects that I CAN"T make implement my given interface, but I would like to run a test at startup time, if the Object has all the methods it is suppose to have? "MMS " made the following annotations. --