if (m_class instanceof EnumDeclaration) {
EnumConstantDeclaration enumdecl = getAST().newEnumConstantDeclaration();
enumdecl.setName(getAST().newSimpleName(name));
StringLiteral strlit = getAST().newStringLiteral();
strlit.setLiteralValue(value);
enumdecl.arguments().add(strlit);
addJavaDoc(doc, enumdecl);
((EnumDeclaration)m_class).enumConstants().add(enumdecl);
} else {
// should not be possible, but just in case of added types in future
throw new IllegalStateException("Internal error - cannot add constant to class type");