private boolean isSimpleEnum ( EnumDeclaration node ) { TypeElement type = node . getTypeElement ( ) ; for ( EnumConstantDeclaration constant : node . getEnumConstants ( ) ) { ExecutableElement method = constant . getExecutableElement ( ) ; if ( method . getParameters ( ) . size ( ) > 0 || method . isVarArgs ( ) ) { return false ; } if ( ElementUtil . hasAnnotation ( method , ObjectiveCName . class ) ) { return false ; } TypeElement valueType = ElementUtil . getDeclaringClass ( method ) ; if ( valueType != type ) { return false ; } } return true ; }
Returns true if an enum doesn t have custom or renamed constructors vararg constructors or constants with anonymous class extensions .