Note, this is not about marshaling a properties object.
I’d like to marshall to a properties format. Example:
class Foo { String a = "aaa"; Item i = new Item(); }
class Item { String val = "Value"; }
marshall( new
into
a = Hello
i.value = Value
I know this approach has it’s limitations, but that’s ok.
Is there something along these lines?
If not, is there some simple expression language lib which can do both – querying object and identifying “string keys” in it’s object tree?
I’ve checked BeanUtils – nothing there.
You can use objectprops(http://code.google.com/p/objectprops/) for this:
Or you could implement this in an easy way using ReflectionToStringBuilder of commons-lang and passing a custom ToStringStyle that you implement yourself, and the load the resulting string into a Properties object.