support annotation based class transformation
(cherry picked from commit 99ead0c)