org.eclipse.xtext.xtext.ecoreInference
Class XtendXtext2EcorePostProcessor
java.lang.Object
org.eclipse.xtext.xtext.ecoreInference.XtendXtext2EcorePostProcessor
- All Implemented Interfaces:
- IXtext2EcorePostProcessor
- Direct Known Subclasses:
- ProjectAwareXtendXtext2EcorePostProcessor
public class XtendXtext2EcorePostProcessor
- extends java.lang.Object
- implements IXtext2EcorePostProcessor
Xtend strategy for interface IXtext2EcorePostProcessor
which delegates the actual post-processing behavior to
an Xtend
based implementation.
- Author:
- Knut Wannheden - Initial contribution and API, Michael Clay
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
XtendXtext2EcorePostProcessor
public XtendXtext2EcorePostProcessor()
process
public void process(GeneratedMetamodel metamodel)
- Description copied from interface:
IXtext2EcorePostProcessor
- Process the given metatmodel (e.g. set default values, make references bi-directional, ...)
- Specified by:
process
in interface IXtext2EcorePostProcessor
- Parameters:
metamodel
- the metatmodel to augment
getResourceLoader
protected org.eclipse.emf.mwe.core.resources.ResourceLoader getResourceLoader(GeneratedMetamodel metamodel)
- Parameters:
metamodel
- the metamodel to augment
- Returns:
- the resource loader used to load resources during the xtend processing
getExecutionContext
protected org.eclipse.xtend.expression.ExecutionContext getExecutionContext(GeneratedMetamodel metamodel)
- Parameters:
metamodel
- the metamodel to augment
- Returns:
- the executionContext used to perform the xtend processing
loadXtendFile
protected org.eclipse.xtend.expression.Resource loadXtendFile(GeneratedMetamodel metamodel)
- Expects an Xtend file named
MyDsl
PostProcessor.ext with an extension with signature
process(xtext::GeneratedMetamodel) in the same folder as the grammar file.
- Parameters:
metamodel
- the metamodel to augment
- Returns:
- the xtendFile to execute
getExtensionName
protected java.lang.String getExtensionName(GeneratedMetamodel metamodel)
getXtendFileLocation
protected org.eclipse.emf.common.util.URI getXtendFileLocation(GeneratedMetamodel metamodel)