method explodeObservers


void explodeObservers()

Fetch a list of all methods annotated with ObserveProperty so we can observe the associated properties.

Source

void explodeObservers() {
  var options = const smoke.QueryOptions(
      includeFields: false,
      includeProperties: false,
      includeMethods: true,
      includeInherited: true,
      includeUpTo: HtmlElement,
      withAnnotations: const [ObserveProperty]);
  for (var decl in smoke.query(type, options)) {
    for (var meta in decl.annotations) {
      if (meta is! ObserveProperty) continue;
      if (_observe == null) _observe = new HashMap();
      for (String name in meta.names) {
        _observe.putIfAbsent(new PropertyPath(name), () => []).add(decl.name);
      }
    }
  }
}