I am working with a 3rd party framework and it turns out I need to wrap some of its objects as a delegate to one of my classes.
class Foo { // 3rd party class.
protected void method() {}
}
class FooWrapper extends Foo {
private Foo mDelegate;
public FooWrapper(Foo inDelegate) {
mDelegate = inDelegate;
}
protected void method() {
mDelegate.method(); // error can't access protected method() of mDelegate
}
}
So there is the problem. I need to delegate this method to the internal object but its protected and therefore not accessible.
Any ideas on ways to solve this particular problem? This is for Java 1.3.