All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.openxma.dsl.common.DslPostProcessor Maven / Gradle / Ivy

There is a newer version: 6.0.2
Show newest version
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);
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy