org.openxma.dsl.common.DslPostProcessor Maven / Gradle / Ivy
package org.openxma.dsl.common;
import org.eclipse.emf.ecore.EEnumLiteral;
import org.eclipse.emf.ecore.EcoreFactory;
public class DslPostProcessor {
public static void addNullValue(org.eclipse.emf.ecore.EEnum eenum) {
if (eenum==null) {
return;
}
for (EEnumLiteral literal : eenum.getELiterals()) {
literal.setValue(literal.getValue() + 1);
}
EEnumLiteral nullLiteral = EcoreFactory.eINSTANCE.createEEnumLiteral();
nullLiteral.setName("NULL");
nullLiteral.setLiteral("NULL");
nullLiteral.setValue(0);
eenum.getELiterals().add(0, nullLiteral);
}
}