The moose likes Java in General and the fly likes java reflection and abstract class Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


JavaRanch » Java Forums » Java » Java in General
Reply Bookmark "java reflection and abstract class" Watch "java reflection and abstract class" New topic
Author

java reflection and abstract class

thomas silver
Ranch Hand

Joined: Jun 20, 2003
Posts: 32
Is there a way to indentiy an abstract class (which contains no abstract method) via java reflection? Thanks.
Ernest Friedman-Hill
author and iconoclast
Marshal

Joined: Jul 08, 2003
Posts: 24081
    
  15

Have a look at the class java.lang.Class. You get ahold of the Class object for the class, then look at the Modifiers for the Class object, one of which might be Modifier.ABSTRACT .


[Jess in Action][AskingGoodQuestions]
Jim Yingst
Wanderer
Sheriff

Joined: Jan 30, 2000
Posts: 18670
Modifier.isAbstract(someClass.getModifiers())


"I'm not back." - Bill Harding, Twister
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: java reflection and abstract class
 
Similar Threads
final class with java reflection
newInstance() doubt
Java Bean, Constructor, Abstract class
Nullpointer exception in servlet
About Abstract Class