Use reflection for compatibility with RAP.

Change-Id: If47fbf29e4eed4df9cff8d10ace535f49a37458c