[stringtemplate-interest] Outputting java.util.Properties
Juergen Weber
weberjn at gmail.com
Fri Feb 2 12:48:17 PST 2007
Hi,
I tried to use java.util.Properties in a template, like
Properties p = new Properties();
p.setProperty("one","1");
p.setProperty("two","2");
How to you program your template to get:
one 1, two 2
I only managed this by copying the Properties into a list of KeyValues
public KeyValue(Object key, Object value)
{
super();
this.key = key;
this.value = value;
}
public Object getKey()
{
return key;
}
public void setKey(Object key)
{
this.key = key;
}
So I could use
<first(props):{<it.value> <it.key><\n>}>
<rest(props):{,<it.value> <it.key><\n>}>
But I feel there must be an easier way to do this...
Thanks,
Jürgen
More information about the stringtemplate-interest
mailing list