Is it possible to make the following code cleaner with less repetition using annotations?
I know it would be possible with java 8 closures, but trying to get this working on java 6/7

```
Variable x = new Variable(this,"HClass","HC"){
    @Override
    String getValue(Player p){
        return getHeroFromPlayer(p).getHeroClass().getName();
    }
};

Variable y = new Variable(this,"HSecClass","HSC"){
    @Override
    String getValue(Player p){
        return getHeroFromPlayer(p).getSecondClass().getName();
    }
};

Variable z = new Variable(this,"HLevel","HL"){
    @Override
    String getValue(Player p){
        return getHeroFromPlayer(p).getLevel();
    }
};

    Variable a = new Variable(this,"HMastered","HMa"){
    @Override
    String getValue(Player p){
        return getHeroFromPlayer(p).isMaster(getHeroFromPlayer(p).getHeroClass()) && (heroSClass == null || getHeroFromPlayer(p).isMaster(heroSClass))
                ? LocaleType.MESSAGE_HEROES_TRUE.getVal() : LocaleType.MESSAGE_HEROES_FALSE.getVal();;
    }
};

```

This goes on for some time, where they are all added to a map, which returns the results lazily.

---

**Edit:** I was hoping that annotations would allow me to do something along the lines of 

```
@Variable("HLevel","HL")
String getHLevel(){getHeroFromPlayer(p).getlevel();}

```

---

**Edit:** Variable.java

```
abstract class Variable {
final private VariableGroup vg;
final private List<String> keys = new Vector<String>();

Variable(VariableGroup vg,String...varargs){
    this.vg = vg;
    for (String s:varargs){
        keys.add(s);
    }
}

abstract String getValue(Player p);

```

}