4. Looking up an Updater.

Listing 4. Looking up an Updater.


public Updater getUpdater(Object target)
{ return getUpdaterForClass(target.getClass());
}

public Updater getUpdaterForClass(Class targetClass)
{ if (updaters.containsKey(targetClass))
  { return (Updater)updaters.get(targetClass);
  }
  return getUpdaterForClass(targetClass.getSuperclass());
}