Replaced the check for specific Enum classes by a call to Class.isEnum().