org.eclipse.xtext.xtext.ecoreInference
Class XtendXtext2EcorePostProcessor

java.lang.Object
  extended by 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

Constructor Summary
XtendXtext2EcorePostProcessor()
           
 
Method Summary
protected  void clearCachedXtendFile()
          Sets cached Xtend file to null so it can be reloaded in loadXtendFile(GeneratedMetamodel)
protected  void fireXtendFileLoaded()
          notify subclasses that the xtend file was successfully loaded
protected  org.eclipse.xtend.expression.ExecutionContext getExecutionContext(GeneratedMetamodel metamodel)
           
protected  java.lang.String getExtensionName(GeneratedMetamodel metamodel)
           
protected  org.eclipse.emf.mwe.core.resources.ResourceLoader getResourceLoader(GeneratedMetamodel metamodel)
           
protected  org.eclipse.emf.common.util.URI getXtendFileLocation(GeneratedMetamodel metamodel)
           
protected  org.eclipse.xtend.expression.Resource loadXtendFile(GeneratedMetamodel metamodel)
          Expects an Xtend file named MyDslPostProcessor.ext with an extension with signature process(xtext::GeneratedMetamodel) in the same folder as the grammar file.
 void process(GeneratedMetamodel metamodel)
          Process the given metatmodel (e.g.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XtendXtext2EcorePostProcessor

public XtendXtext2EcorePostProcessor()
Method Detail

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 MyDslPostProcessor.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

fireXtendFileLoaded

protected void fireXtendFileLoaded()
notify subclasses that the xtend file was successfully loaded


clearCachedXtendFile

protected final void clearCachedXtendFile()
Sets cached Xtend file to null so it can be reloaded in loadXtendFile(GeneratedMetamodel)


getExtensionName

protected java.lang.String getExtensionName(GeneratedMetamodel metamodel)

getXtendFileLocation

protected org.eclipse.emf.common.util.URI getXtendFileLocation(GeneratedMetamodel metamodel)