Jason Stonebraker  committed 5da5cc1

Edited online

  • Participants
  • Parent commits 4c8b0d6

Comments (0)

Files changed (1)

+###What's actually happening? 
+Basically the `excludeFor*()` method creates a Named Configuration with a name of
+'excludeForWhateverYouDecideToNameIt'. The Named Configuration then registers a custom ObjectMarshaller for the TestStudent domain class. The custom object marshaller is built into the `excludesFor*` sythesized method. It removes the properties we provided to it in the list. The JSON converter then outputs the desired JSON formatted string.
 ## Installation
 As a Dependency: 
 ```compile ":json-exclusion-marshaller:0.2"```
 ```grails install-plugin json-exclusion-marshaller```
 ## What problem does the plugin solve?
 The grails.converter.JSON class is powerful. That power comes at the cost of some complexity though. This plugin utilizes Groovy's meta-programming features to simplify the common task of excluding arbitrary properties from the JSON payload at run-time. The most common use for this plugin will be to simply ensure that the 'id' and 'class' properties added by GORM are not included in the JSON string. Basically, it allows you to tackle this common task using expressive, domain specific language, quickly and simply. It also makes it simple to determine at run-time which properties to exclude.
 ### Other resources and discussion surrounding this issue
 [Rendering JSON in Grails: Part 3 Customise your JSON with Object Marshallers](
 ### Improvements to be made
+* Make useful for all pogos, not just Grails Domain Classes.
 * Infer the class type of the target object rather than requiring it to be passed in. This is a challenge since the paradigm is based on static methods.
 * Stacking named marshallers to apply multiple marshallers to a single converter instance
 * Instance level ObjectMarshalling