If I understand you correctly, you want to access members of the outer class from the class extending the inner class.
You can only do this depending on the scope in which you declare your class. When you extend the inner class inside the outer class, all members are in scope and you can access them, something like
class Outer {
private int var = 0;
class Inner {}
class My extends Outer.Inner {
My() {
var = 1;
}
}
}
If you declare the class outside the outer class, you can still access package private members if the extending type is in the same package
class Outer {
int var = 0;
class Inner {}
}
class My extends Outer.Inner {
My( Outer outer ) {
outer.super();
outer.var = 1;
}
}
If you're outside package scope, you might solve this by enclosing your class inheriting the inner class in a class inheriting the outer class to get access to its protected members:
class Outer {
protected int var = 0;
class Inner {}
}
class OuterMy extends Outer {
class My extends Inner {
My( Outer outer ) {
var = 1;
}
}
}
If that isn't an option either, you only get access to the public members by storing the outer instance manually.
class Outer {
public int var = 0;
class Inner {}
}
class My extends Outer.Inner {
private Outer outer;
My( Outer outer ) {
outer.super();
this.outer = outer;
}
void method() {
outer.var = 1;
}
}
As far as I know those are your options, you cannot access the JVMs internal instance of the enclosing class