my question is what is the best way to access Scan and its methods like isEnabled() in the parent.$Child in the below scenario:
I know one way, that is add an abstract method in Parent.$Child like getScan(), implement it in $ScanTest. But is there any other better way to do it.
public abstract class Parent {
protected abstract void execute() throws SQLException;
protected static abstract class $Child extends Parent {
protected void execute() throws SQLException {
Scan.this.isEnabled(); //Is there a way I can access Scan.this.isEnabled() as Scan is a Parent class ?
}
}
}
public class Scan{
private static final String TYPE = "scan_version";
public boolean isEnabled() {
return true;
}
private class $ScanTest extends Parent.$Child {
public void test() {
boolean isEnabled = Scan.this.isEnabled();
//like this, wants to access it in $ScanTest parent class
}
}
}