add support for Java enum, do not support Scala enum (see Read comment).