cognitect / transit-java

transit-format implementation for Java
Apache License 2.0
62 stars 21 forks source link

enable write handler for java.lang.Object #22

Closed mikub closed 8 years ago

mikub commented 8 years ago

current version does not allow for adding a generic handler for java.lang.Object. This however is desirable and would be tremendously useful when i just want to add a generic handler for objects that don't have a specific custom handler to prevent runtime exceptions ("java.lang.Exception: Not supported") whenever some new object sneaks onto the transit data. Though an application should always sanitize the data before sending them over the wire (to make sure only 'serializable' data are sent), the application might not be aware of what transit handlers are currently supported. Sanitizing the data before handing them over to transit would thus lead to handler duplication and tight coupling. By adding a generic handler for java.lang.Object a user can thus decide - e.g. for the remaining objects that don't have handler I want them serialized via nippy or converted to String etc.

dchelimsky commented 8 years ago

Thanks for the contribution, but this project doesn't accept pull requests: https://github.com/cognitect/transit-java#contributing.