I need something like a property bag to throw key value pairs into.
I want to create list of such objects, initialize them in bean and then use the list to render table in JSF template.
I know how to do it, but I want to avoid creating some special class for that case, like OrderLineItem
and using List<OrderLineItem>
.
I do not want to define new class.
In PHP I could use StdClass.
StdClass is a sparsely documented class in PHP which has no predefined members.
$object = new StdClass;
$object->foo = 'bar';
But, as far as I know, Primefaces <p:dataTable>
list item must be an object with getter.
If I want to reference <h:outputText value="#{item.title}" />
, my list object should have getTitle()
method.
Is there any walkaround in my case or I really need to define special class to make life easier?
Thanks.