| OLD | NEW |
| 1 part of protobuf; | 1 part of protobuf; |
| 2 | 2 |
| 3 /// An EventPlugin receives callbacks when the fields of a GeneratedMessage | 3 /// An EventPlugin receives callbacks when the fields of a GeneratedMessage |
| 4 /// change. | 4 /// change. |
| 5 /// | 5 /// |
| 6 /// A GeneratedMessage mixin can install a plugin by overriding the eventPlugin | 6 /// A GeneratedMessage mixin can install a plugin by overriding the eventPlugin |
| 7 /// property. The intent is provide mechanism, not policy; each mixin defines | 7 /// property. The intent is provide mechanism, not policy; each mixin defines |
| 8 /// its own public API, perhaps using streams. | 8 /// its own public API, perhaps using streams. |
| 9 /// | 9 /// |
| 10 /// This is a low-level, synchronous API. Event handlers are called in the | 10 /// This is a low-level, synchronous API. Event handlers are called in the |
| 11 /// middle of protobuf changes. To avoid exposing half-finished changes | 11 /// middle of protobuf changes. To avoid exposing half-finished changes |
| 12 /// to user code, plugins should buffer events and send them asynchronously. | 12 /// to user code, plugins should buffer events and send them asynchronously. |
| 13 /// (See event_mixin.dart for an example.) | 13 /// (See event_mixin.dart for an example.) |
| 14 abstract class EventPlugin { | 14 abstract class EventPlugin { |
| 15 | 15 |
| 16 /// Initializes the plugin. | 16 /// Initializes the plugin. |
| 17 /// | 17 /// |
| 18 /// GeneratedMessage calls this once in its constructors. | 18 /// GeneratedMessage calls this once in its constructors. |
| 19 void attach(GeneratedMessage parent); | 19 void attach(GeneratedMessage parent); |
| 20 | 20 |
| 21 /// If false, GeneratedMessage will skip calls to event handlers. | 21 /// If false, GeneratedMessage will skip calls to event handlers. |
| 22 bool get hasObservers; | 22 bool get hasObservers; |
| 23 | 23 |
| 24 /// Called before setting a field if startGroup returned true. | 24 /// Called before setting a non-extension field. |
| 25 /// | 25 /// |
| 26 /// For repeated fields, this will be called in getField() when | 26 /// For repeated fields, this will be called in getField() when |
| 27 /// the PbList is created. | 27 /// the PbList is created. |
| 28 void beforeSetField(int tag, newValue); | 28 void beforeSetField(int tag, newValue); |
| 29 | 29 |
| 30 /// Called before clearing a field if startGroup returned true. | 30 /// Called before clearing a non-extension field. |
| 31 void beforeClearField(int tag); | 31 void beforeClearField(int tag); |
| 32 } | 32 } |
| OLD | NEW |