Is there a pointer-to-member equivalent in Java?
<p>I have a class which holds some colors for a GUI, which the program can change to its liking. For a specific element of the GUI, I'd like to be able to specify a color which is a member of that class. In C++, I could use something like</p>

<pre><code>int Pallete::*color = &amp;Pallete::highlight;
Pallete pallete; // made in or passed to the constructor
// ...
void draw() {
    drawing.color(pallete.*color);
    // ...
}
</code></pre>

<p>Is there an equivalent in java? I've thought about using <code>getField(String)</code> in the Class class, or keeping the colors in a Map with string keys, but neither of these seem like very good solutions, because they rely on strings, and the compiler can't enforce that they are actually members of Pallete. I could also put all of the color names in an enum, and have some getter function which returns the associated color, but that seems like more work for me.</p>
