The idea off hooking into graph traversal is an interesting concept. I would suggest events and handlers to get notified when a model / property is written to JSON resp. read from JSON:
public interface JsonWriter<T> {
...
HandlerRegistration addWriteModelHandler(WriteModelHandler<T> handler);
HandlerRegistration addWritePropertyHandler(WritePropertyHandler<?> handler);
...
}
public interface WriteModelHandler<T> extends EventHandler {
void onBeforeWriteModel(WriteModelEvent<T> event);
void onAfterWriteModel(WriteModelEvent<T> event);
}
public interface WritePropertyHandler<T> extends EventHandler {
void onBeforeWriteProperty(WritePropertyEvent<T> event);
void onAfterWriteProperty(WritePropertyEvent<T> event);
void onSkipProperty(WritePropertyEvent<T> event);
}
What do you think?
- Harald
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To view this discussion on the web visit https://groups.google.com/d/msg/google-web-toolkit/-/YtYiFPLwe28J.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to google-web-toolkit+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
No comments:
Post a Comment