Is there a way to "inherit" imports?
Example:
Common enum:
public enum Constant{ ONE, TWO, THREE }
Base class using this enum:
public class Base {
protected void register(Constant c, String t) {
...
}
}
Sub class needing an import to use the enum constants convenient (without enum name):
import static Constant.*; // want to avoid this line!
public Sub extends Base {
public Sub() {
register(TWO, "blabla"); // without import: Constant.TWO
}
}
and another class with same import ...
import static Constant.*; // want to avoid this line!
public AnotherSub extends Base {
...
}
I could use classic static final constants but maybe there is a way to use a common enum with the same convenience.