Files changed (1)
Welcome to your wiki! This is the default page we've installed for your convenience. Go ahead and edit it.
-The wiki itself is actually a git repository, which means you can clone it, edit it locally/offline, add images or any other file type, and push it back to us. It will be live immediately.
Wiki pages are normal files, with the .md extension. You can edit them locally, as well as creating new ones.
+Next we make use of the excludeFor*() method. You can write anything that makes sense to your domain between "excludeFor" and "()". The whole method name is what you'll use next to marshall the object into the form you want.
+We specify which properties a teacher is allowed to see by creating an "excluder" (don't look for documentation for a class named "Excluder". That's just what I call ObjectMarshallers that exclude properties). In our domain, teachers aren't allowed to see a students' social security numbers and the client developer has no need for GORM's id and class attributes.
+Finally, we use this excluder (ObjectMarshaller) to instantiate a JSON converter that will only output the properties appropriate for teachers to see.
+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.
+[GRAILS-5791: "Create a way to easily exclude properties from Serialization when using the XML or JSON converters"](http://jira.grails.org/browse/GRAILS-5791)
+[Official Grails Documentation: Using Named Configurations for Object Marshallers](http://grails.org/doc/2.3.x/guide/webServices.html#namedObjectMarshallers)
+[StackOverflow: "grails.converters.JSON except few properties"](http://stackoverflow.com/questions/5936300/grails-converters-json-except-few-properties)
-You can check out the source of this page to see how that's done, and make sure to bookmark [the vast library of Pygment lexers][lexers], we accept the 'short name' or the 'mimetype' of anything in there.
+[Rendering JSON in Grails: Part 3 Customise your JSON with Object Marshallers](http://manbuildswebsite.com/2010/02/15/rendering-json-in-grails-part-3-customise-your-json-with-object-marshallers/)
+* 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.
+This is my first grails plugin. I hope you find it useful. I'm three weeks new to Groovy and Grails, and those three weeks have been spent reading related books and staying productive at work. I welcome any suggestions/code contributions that would improve the plugin until Graeme and team are able to make updates to the JSON converter class to support this type of behavior.