Extending/replacing a class without a public constructor
From: Hugh Beyer (beyerxyzzy_at_acm.org)
Date: 06/10/04
- Next message: Andy Fish: "Re: What is the best way to search for a set of values within a multi-dimenstional array?"
- Previous message: John C. Bollinger: "Re: Infinite loops in hashCode() and equals()"
- Next in thread: John C. Bollinger: "Re: Extending/replacing a class without a public constructor"
- Reply: John C. Bollinger: "Re: Extending/replacing a class without a public constructor"
- Reply: Mike Schilling: "Re: Extending/replacing a class without a public constructor"
- Reply: Shane Mingins: "Re: Extending/replacing a class without a public constructor"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Thu, 10 Jun 2004 16:48:56 GMT
I'm having a really frustrating problem and I hope you guys can give me
some help.
I'm trying to write a test suite for a graphics-heavy app that uses
MIDP/J2ME. These apps use the Graphics class to do their screen updates.
What I want to do is subclass the Graphics class with my own class that
captures all calls and writes to a log that my tests can later examine.
Unfortunately, all the constructors of the Graphics class are private. The
system passes in a Graphics class when it's time to update the screen, and
you can also create a graphics class through a static factory method
(Image.getGraphics()). But either way, I can't get in and capture the
method calls to the resulting Graphics object.
Is there any way at all to do this, or am I SOL? Can anyone think of
another way to accomplish what I want?
Hugh
- Next message: Andy Fish: "Re: What is the best way to search for a set of values within a multi-dimenstional array?"
- Previous message: John C. Bollinger: "Re: Infinite loops in hashCode() and equals()"
- Next in thread: John C. Bollinger: "Re: Extending/replacing a class without a public constructor"
- Reply: John C. Bollinger: "Re: Extending/replacing a class without a public constructor"
- Reply: Mike Schilling: "Re: Extending/replacing a class without a public constructor"
- Reply: Shane Mingins: "Re: Extending/replacing a class without a public constructor"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|