org.eclipse.xpand2
Class Generator

java.lang.Object
  extended by org.eclipse.emf.mwe.core.lib.AbstractWorkflowComponent
      extended by org.eclipse.emf.mwe.core.lib.AbstractWorkflowComponent2
          extended by org.eclipse.xtend.expression.AbstractExpressionsUsingWorkflowComponent
              extended by org.eclipse.xpand2.Generator
All Implemented Interfaces:
org.eclipse.emf.mwe.core.WorkflowComponent, org.eclipse.emf.mwe.core.WorkflowComponentWithID, org.eclipse.emf.mwe2.runtime.workflow.IWorkflowComponent

public class Generator
extends AbstractExpressionsUsingWorkflowComponent


Nested Class Summary
 
Nested classes/interfaces inherited from class org.eclipse.xtend.expression.AbstractExpressionsUsingWorkflowComponent
AbstractExpressionsUsingWorkflowComponent.Debug, AbstractExpressionsUsingWorkflowComponent.GlobalVar, AbstractExpressionsUsingWorkflowComponent.GlobalVarDef
 
Field Summary
protected  java.util.List<java.lang.String> advices
           
protected  java.lang.String expand
           
protected  java.util.List<java.lang.String> extensionAdvices
           
 
Fields inherited from class org.eclipse.xtend.expression.AbstractExpressionsUsingWorkflowComponent
_advice, callback, exceptionHandler, exceptionsOnNullEvaluation, log, metaModels
 
Constructor Summary
Generator()
           
 
Method Summary
 void addAdvice(java.lang.String advice)
          Adds an advice.
 void addExtensionAdvice(java.lang.String extensionAdvice)
          Adds an extension advice.
 void addOutlet(Outlet outlet)
          Adds an outlet.
protected  void checkConfigurationInternal(org.eclipse.emf.mwe.core.issues.Issues issues)
           
protected  XpandExecutionContext createExecutionContext(org.eclipse.emf.mwe.core.WorkflowContext wfContext, org.eclipse.emf.mwe.core.monitor.ProgressMonitor monitor, org.eclipse.emf.mwe.core.issues.Issues issues)
          Creates the execution context that is used for evaluation of the Xpand generator.
protected  Outlet createOutlet()
          Creates an Outlet instance.
protected  Output createOutput()
          Creates an Output instance.
 java.util.List<? extends PostProcessor> getBeautifier()
          Deprecated. Will be removed in 2.0
 java.lang.String getComponentName()
           
 java.lang.String getFileEncoding()
          Returns the name of character encoding used for the output file.
 java.lang.String getLogMessage()
           
 java.util.List<Outlet> getOutlets()
          Retrieves the configured and initialized outlets of the generator.
protected  Output getOutput()
           
protected  ProtectedRegionResolver getProtectedRegionResolver()
           
protected  ExpandStatement getStatement()
           
protected  void invokeInternal2(org.eclipse.emf.mwe.core.WorkflowContext ctx, org.eclipse.emf.mwe.core.monitor.ProgressMonitor monitor, org.eclipse.emf.mwe.core.issues.Issues issues)
           
 void setAutomaticHyphens(boolean automaticHyphens)
          Enables or disables the automatic hyphenation.
 void setBeautifier(java.util.List<? extends PostProcessor> beautifiers)
          Deprecated. Configure PostProcessors per Outlet
 void setExpand(java.lang.String invoke)
          Sets the statement that is to expand by the generator.
 void setFileEncoding(java.lang.String fileEncoding)
          Sets the character encoding used for the output file.
 void setGenPath(java.lang.String genPath)
          Deprecated. use addOutlet(Outlet) instead
 void setOutput(Output output)
          Sets the output.
 void setPrDefaultExcludes(boolean prDefaultExcludes)
          Enables oder disables the default excludes for protected regions.
 void setPrExcludes(java.lang.String prExcludes)
          Sets the additional excludes for protected regions.
 void setPrSrcPaths(java.lang.String prSrcPathes)
          Sets the source paths for protected regions.
 void setSrcPath(java.lang.String srcPath)
          Deprecated. use outlets instead
 
Methods inherited from class org.eclipse.xtend.expression.AbstractExpressionsUsingWorkflowComponent
addAdvices, addDebug, addExtensionAdvices, addGlobalVar, addGlobalVarDef, addMetaModel, getExecutionContext, getGlobalVars, getNullEvaluationHandler, getResourceManager, invokeInternal, setCallback, setDumpContext, setExceptionHandler, setExceptionsOnNullEvaluation, setResourceManager, setVetoableCallback, toString
 
Methods inherited from class org.eclipse.emf.mwe.core.lib.AbstractWorkflowComponent2
checkConfiguration
 
Methods inherited from class org.eclipse.emf.mwe.core.lib.AbstractWorkflowComponent
checkRequiredConfigProperty, getBridge, getContainer, getId, getLocation, invoke, invoke, postInvoke, preInvoke, setContainer, setId, setLocation, setSkipOnErrors
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

expand

protected java.lang.String expand
Since:
1.4

advices

protected final java.util.List<java.lang.String> advices
Since:
1.4

extensionAdvices

protected final java.util.List<java.lang.String> extensionAdvices
Since:
1.4
Constructor Detail

Generator

public Generator()
Method Detail

setAutomaticHyphens

public void setAutomaticHyphens(boolean automaticHyphens)
Enables or disables the automatic hyphenation. If automatic hyphenation is enabled, redundant blank lines are avoided automatically.

Parameters:
automaticHyphens - If true, automatic hyphenation is enabled, otherwise disabled.

getLogMessage

public java.lang.String getLogMessage()
Specified by:
getLogMessage in interface org.eclipse.emf.mwe.core.WorkflowComponentWithID
Overrides:
getLogMessage in class org.eclipse.emf.mwe.core.lib.AbstractWorkflowComponent
See Also:
AbstractWorkflowComponent.getLogMessage()

addAdvice

public void addAdvice(java.lang.String advice)
Adds an advice.

Overrides:
addAdvice in class AbstractExpressionsUsingWorkflowComponent
Parameters:
advice - the advice

addExtensionAdvice

public void addExtensionAdvice(java.lang.String extensionAdvice)
Adds an extension advice.

Overrides:
addExtensionAdvice in class AbstractExpressionsUsingWorkflowComponent
Parameters:
extensionAdvice - the extension advice

getBeautifier

@Deprecated
public java.util.List<? extends PostProcessor> getBeautifier()
Deprecated. Will be removed in 2.0

Returns the list of beautifiers that will be applied to the generated output.

Returns:
list of beautifiers

setBeautifier

@Deprecated
public void setBeautifier(java.util.List<? extends PostProcessor> beautifiers)
Deprecated. Configure PostProcessors per Outlet

Sets the list of beautifiers that will be applied to the generated output.

Parameters:
beautifiers - list of beautifiers

setFileEncoding

public void setFileEncoding(java.lang.String fileEncoding)
Sets the character encoding used for the output file.

Parameters:
fileEncoding - name of character encoding

getFileEncoding

public java.lang.String getFileEncoding()
Returns the name of character encoding used for the output file.

Returns:
name of character encoding

setGenPath

@Deprecated
public void setGenPath(java.lang.String genPath)
Deprecated. use addOutlet(Outlet) instead

Sets the path for always generated sources. This will create two Outlets for this path: The default outlet, and an Outlet with name "APPEND" and setting append=true


setExpand

public void setExpand(java.lang.String invoke)
Sets the statement that is to expand by the generator.

Parameters:
invoke - statement to expand

setPrDefaultExcludes

public void setPrDefaultExcludes(boolean prDefaultExcludes)
Enables oder disables the default excludes for protected regions.

Parameters:
prDefaultExcludes - If true, the default excludes are enabled, otherwise disabled.

setPrExcludes

public void setPrExcludes(java.lang.String prExcludes)
Sets the additional excludes for protected regions.

Parameters:
prExcludes - the excludes

setPrSrcPaths

public void setPrSrcPaths(java.lang.String prSrcPathes)
Sets the source paths for protected regions.

Parameters:
prSrcPathes - the source paths

getComponentName

public java.lang.String getComponentName()
Specified by:
getComponentName in interface org.eclipse.emf.mwe.core.WorkflowComponent
Overrides:
getComponentName in class org.eclipse.emf.mwe.core.lib.AbstractWorkflowComponent
See Also:
AbstractWorkflowComponent.getComponentName()

setSrcPath

@Deprecated
public void setSrcPath(java.lang.String srcPath)
Deprecated. use outlets instead


invokeInternal2

protected void invokeInternal2(org.eclipse.emf.mwe.core.WorkflowContext ctx,
                               org.eclipse.emf.mwe.core.monitor.ProgressMonitor monitor,
                               org.eclipse.emf.mwe.core.issues.Issues issues)
Overrides:
invokeInternal2 in class AbstractExpressionsUsingWorkflowComponent

createExecutionContext

protected XpandExecutionContext createExecutionContext(org.eclipse.emf.mwe.core.WorkflowContext wfContext,
                                                       org.eclipse.emf.mwe.core.monitor.ProgressMonitor monitor,
                                                       org.eclipse.emf.mwe.core.issues.Issues issues)
Creates the execution context that is used for evaluation of the Xpand generator.

Since:
1.4

getProtectedRegionResolver

protected ProtectedRegionResolver getProtectedRegionResolver()

addOutlet

public void addOutlet(Outlet outlet)
Adds an outlet.

Parameters:
outlet - the outlet

setOutput

public void setOutput(Output output)
Sets the output.

Parameters:
output - the output

getOutput

protected final Output getOutput()
Since:
1.4

getOutlets

public final java.util.List<Outlet> getOutlets()
Retrieves the configured and initialized outlets of the generator.


getStatement

protected final ExpandStatement getStatement()
Since:
1.4

checkConfigurationInternal

protected void checkConfigurationInternal(org.eclipse.emf.mwe.core.issues.Issues issues)
Overrides:
checkConfigurationInternal in class AbstractExpressionsUsingWorkflowComponent

createOutput

protected Output createOutput()
Creates an Output instance.

Returns:
Instance of OutputImpl. Setting automaticHyphens will be considered.
Since:
1.4

createOutlet

protected Outlet createOutlet()
Creates an Outlet instance.

Since:
1.4