java reflection issue
<p>I have this code:</p>

<pre><code>public static final &lt;TypeVO extends BaseVo&gt; List&lt;SelectItem&gt; populateSelectBoxForType(
            final Class&lt;TypeVO&gt; voClass, final String fieldName) {
        List&lt;SelectItem&gt; listSelectBox = null;
        final List&lt;TypeVO&gt; vosList = GenericEjbProxyFactory
                .getGenericTopValueObjectProxy(voClass)
                .getAllValueObjects(null);
        System.out.println("loaded vosList!!!!");
        if (vosList != null) {
            listSelectBox = new ArrayList&lt;SelectItem&gt;();
            for (final TypeVO currVo : vosList) {
                listSelectBox.add(new SelectItem(currVo.getInternalId(), currVo.getName()));
            }
        }
        return listSelectBox;
    }
</code></pre>

<p>As you see here, I'm using currVo.getName because always, currVo has a name property.</p>

<p>I want to be able to use also other fields from this currVo which has type as voClass, but not all currVo classes will contain this field so I have to use reflection to identify these getField method, something like:</p>

<pre><code>for (final TypeVO currVo : vosList) {
                for (final Method m : voClass.getMethods()) {
                    if (m.getName().contains(fieldName)) {
                        listSelectBox.add(new SelectItem(
                                currVo.getInternalId(), currVo.m));
                    }
                }
            }
</code></pre>

<p>What I do not know is HOW I can use that specific method's value when I find it, exactly like currVo.getName (because, of course, <strong>currVo.m is wrong</strong>)?</p>

<p>Eg: If fieldName is "Age" I want to put in the list: <code>currVo.getAge()</code>... I am simply blocked here...</p>
