• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Applet introspection

 
Angus Rose
Ranch Hand
Posts: 56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is it possible to load an applet into an application and use the reflection api in order to see what methods and attributes the applet conatins?
 
Ernest Friedman-Hill
author and iconoclast
Marshal
Pie
Posts: 24208
35
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes.
 
Angus Rose
Ranch Hand
Posts: 56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well thanks for the short and sweet reply. The next question is how?
 
Ernest Friedman-Hill
author and iconoclast
Marshal
Pie
Posts: 24208
35
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
An applet is no different from any other object. You get the Class object for the applet class, then use the getDeclaredMethods() and getDeclaredFields() methods to investigate it.
 
Angus Rose
Ranch Hand
Posts: 56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can it be done on an applet that is currently running in a browser?
 
Ernest Friedman-Hill
author and iconoclast
Marshal
Pie
Posts: 24208
35
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sure, by code in the applet itself, or by another applet on the same page if the target applet has the MAYSCRIPT="TRUE" attribute on the HTML page.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic