add annotations like
public void foo(@Default(10) int x, @Default("hello") String y)
{...}
public void foo(int x, String y) {...}
that expands in superclass to
public abstract void foo(int x, String y);
public void foo(int x) {foo(x, "hello");}
public void foo(String y) {foo(10, y);}
public void foo() {foo(10, "hello");}
if parameter types are unique enough(by type), can have all permutations.
if some parameter types are the same, need to define positionally --
cannot have
public void foo(@Default(10) int x, @Default("hello") String y)
{...}
define
public abstract void foo(int x, int y);
public void foo(int x) {foo(x, 20);}
public void foo(int y) {foo(10, y);}
public void foo() {foo(10, 20);}
won't compile -- need to generate
public abstract void foo(int x, int y);
public void foo() {foo(10, 20);}
public void foo(int x) {foo(x, 20);}
easiest way to implement and describe would be to just say parameters can
only be dropped from the end, ough:
public void foo(@Default(10) int x, @Default("hello") String y)
{...}
would expand in superclass to
public void foo() {foo(10, "hello");}
public void foo(int x) {foo(x, "hello");}
public abstract void foo(int x, String y);
by just adding one parameter at a time
user could always add other overrides for missing permutations...
Original issue reported on code.google.com by scott%ja...@gtempaccount.com on 23 Jul 2008 at 1:59
Original issue reported on code.google.com by
scott%ja...@gtempaccount.com
on 23 Jul 2008 at 1:59