Is there an optimal way to refer to attributes of java objects?
<p>I was using the JExcel Plugin and i was noticing that i was writing the same code for a different set of objects.  (Example shown below).</p>

<pre><code>loanProfileListSheet.addCell(new label(0,rowNum,loanProfileView.getBorrowersList().getBorrowerPartnerId()));
loanProfileListSheet.addCell(new Label(1,rowNum,loanProfileView.getBorrowersList().getFirstName() + " " +   loanProfileView.getBorrowersList().getLastName()));
</code></pre>

<p>Now I want to know if there is an optimal way to pass a generic object to a utility method which would give me the object i need (so instead of writing somthing like loanProfileView.getBorrowersList().getFirstName(), i would have a util as such</p>

<pre><code>Workbook getWorkBook (List&lt;Object&gt; objectList, List&lt;String&gt; attributes, Hashmap&lt;String, String&gt; attributeHeaders)
</code></pre>

<p>This way i would be able to pass any set of objects and get an excel workbook</p>
