|Re: Extending EMF Code Generator [message #489614 is a reply to message #489608]
||Mon, 05 October 2009 10:41
| Ed Merks
Registered: July 2009
The GenModel supports annotations. In the editor you can use |
Generator->Show Annotations and then on any object you can use Annotate
from the popup to create an annotation and you can use Add Detail on the
popup for that to create key/value pairs; it works much like
EAnnotations. Later you can use getGenAnnotation(<source>).get(<key>)
to retrieve a <value>. In this way you could add the additional
information your extension needs using an annotation rather than needing
an extended GenModel...
> Thanks Ed,
> I looked at the org.eclipse.emf.examples.generator.validator example.
> In org.eclipse.emf.examples.generator.validator.ValidatorGenera torUtil,
> public static String getValidationPackageName(GenPackage genPackage)
> String basePackage = genPackage.getInterfacePackageName();
> return basePackage.length() > 0 ? basePackage + ".validation" :
> This basically creates a "$CLASSNAME"Validator.java in the
> "$basepackage".validation package.
> My requirement is to create the class in a package which can be
> specified in the GenModel by the developer. Like the current packages
> for interface,Impl,provider etc I want add a validator in the property
> page for GenPackage.
> Can I do that without extending GenModel(or GenPackage)?
Professional Support: https://www.macromodeling.com/
Powered by FUDForum
. Page generated in 0.02088 seconds