talios/halbuilder — pull request #29 by steveg103 (2012-05-04 15:19:04+00:00)
Title: Rendering complex properties

Hi,

This is probably worthy of some discussion to verify whether this is accepted/expected HAL behavior, but if HAL allows for resource properties to be arbitrarily complex structures (not just primitive string/number/bool stuff), then I should be able to build something like the below:

````
... in a JSON HAL document ...
"age" : 33,
"complexProperty" : {
"fieldOne" : 1,
"fieldTwo" : "hello",
"fieldThree" : {
"nestedFieldOne" : "hi"
}
},
"expired" : false,
...
````

The attached code allows for the rendering of complex properties in this way. The JSON was easy, just adding the ObjectMapper to the renderer, Jackson serializes the POJOs without much effort. The XML was a bit uglier.

This doesn't address the builder being able to read these sorts of properties in, only to render them. I gave it a quick try, but that seems like a tougher nut to crack - maybe a decision needs to be made about what internal data format to deserialize both formats into, and then the readers do it that way and the renderers process that particular format. Any thoughts on that?