What should be the value
value to add a new enum constant to the type type
?
public void addEnumConstant(IType type, String value){
if(type.isEnum()){
type.createField(value, null, false, null);
}
}
Edit: I guess I was too brief, so I add more information about my problem
I am using the JavaModel framework and want to add an enum constant to IType object. I want to avoid explicit use of AST.
It is easy to add a new method to a type, by following code:
IType type = [...];
type.createMethod("public void method(){}", null, false, null);
Also I can add a variable field:
type.createField("public int var", null, false, null);
but I have no idea how to add an enum constant.