-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support for view of Map #44
Comments
The most important case is that of a map whose values are simple types, submaps, and arrays/lists; i.e. those maps that can be translated directly to JSON or XML. In this case, the view template doesn't need to specify any nodes other than a node for the map itself, and it provides no mechanism to override the behavior of including everything in the map in the view. |
There are essentially two possible approaches for implementing this:
In either case, when generating a view, the values in a map will need to be recursively evaluated to determine their representation in the view event stream.
When applying a view, if the (declared) data type of a the corresponding view node is a Map, the applicator needs to anticipate a sub-stream of events for an object. Within the sub-stream, the event type (object, array, value) determines what sort of object is to be constructed and injected; i.e. within the sub-stream there are no corresponding view nodes to guide what is injected. As a map is recursively evaluated, frames will be pushed onto the view context in the same manner as when recursively evaluating the properties of a Java object. This will provide appropriate path information needed by various user-provided add-ons such as converters, URL path template resolvers, etc. Need to explore how various listeners might be used with map nodes or value nodes with map data types. It seems like property listeners/interceptors are applicable as the "properties" of a map are traversed. The other listener types don't seem applicable. Are other listener types needed? |
Want to be able to produce a view (or sub-view) based on a map.
The text was updated successfully, but these errors were encountered: