Package org.eclipse.epsilon.egl
Class EglFileGeneratingTemplate
- java.lang.Object
-
- org.eclipse.epsilon.egl.EglTemplate
-
- org.eclipse.epsilon.egl.EglPersistentTemplate
-
- org.eclipse.epsilon.egl.EglFileGeneratingTemplate
-
public class EglFileGeneratingTemplate extends EglPersistentTemplate
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
EglFileGeneratingTemplate.OutputMode
-
Field Summary
-
Fields inherited from class org.eclipse.epsilon.egl.EglPersistentTemplate
outputRoot, outputRootPath
-
Fields inherited from class org.eclipse.epsilon.egl.EglTemplate
listeners, module, name, template
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
EglFileGeneratingTemplate(URI path, IEglContext context, URI outputRoot)
EglFileGeneratingTemplate(EglTemplateSpecification spec, IEglContext context, URI outputRoot)
EglFileGeneratingTemplate(EglTemplateSpecification spec, IEglContext context, URI outputRoot, String outputRootPath)
-
Method Summary
-
Methods inherited from class org.eclipse.epsilon.egl.EglPersistentTemplate
addMessage, generate, generate, name, resolveFile, store, store
-
Methods inherited from class org.eclipse.epsilon.egl.EglTemplate
getContents, getDeclaredModelDefinitions, getDeclaredOperations, getFormatter, getImports, getIncrementalitySettings, getModelDefinitions, getModule, getName, getOperations, getParseProblems, getTemplate, isProcessed, merge, populate, printWarning, process, reset, setFormatter, setFormatters, setFormatters, setIncrementalitySettings
-
-
-
-
Constructor Detail
-
EglFileGeneratingTemplate
protected EglFileGeneratingTemplate(URI path, IEglContext context, URI outputRoot) throws Exception
- Throws:
Exception
-
EglFileGeneratingTemplate
public EglFileGeneratingTemplate(EglTemplateSpecification spec, IEglContext context, URI outputRoot, String outputRootPath) throws Exception
- Throws:
Exception
-
EglFileGeneratingTemplate
public EglFileGeneratingTemplate(EglTemplateSpecification spec, IEglContext context, URI outputRoot) throws Exception
- Parameters:
spec
-context
-outputRoot
-- Throws:
Exception
- Since:
- 1.6
-
-
Method Detail
-
append
public File append(String path) throws EglRuntimeException
- Throws:
EglRuntimeException
-
patch
public File patch(String path) throws EglRuntimeException
- Throws:
EglRuntimeException
-
write
protected File write(String path, EglFileGeneratingTemplate.OutputMode outputMode) throws EglRuntimeException
- Throws:
EglRuntimeException
-
doGenerate
protected void doGenerate(File target, String targetName, boolean overwrite, boolean merge) throws EglRuntimeException
Description copied from class:EglPersistentTemplate
Store result of processing template in the given file. Subclasses should override to implement the specific semantics of 'storing' to a file. The result of processing the template will be available fromEglTemplate.contents
.- Specified by:
doGenerate
in classEglPersistentTemplate
- Throws:
EglRuntimeException
-
prepareNewContents
protected void prepareNewContents() throws EglRuntimeException
- Throws:
EglRuntimeException
-
writeNewContentsIfDifferentFromExistingContents
protected void writeNewContentsIfDifferentFromExistingContents() throws URISyntaxException, IOException
- Throws:
URISyntaxException
IOException
-
isOverwriteUnchangedFiles
protected boolean isOverwriteUnchangedFiles()
-
write
protected void write() throws IOException, URISyntaxException
- Throws:
IOException
URISyntaxException
-
addProtectedRegionWarning
protected void addProtectedRegionWarning(ProtectedRegionWarning warning)
- Overrides:
addProtectedRegionWarning
in classEglTemplate
-
getTarget
public File getTarget()
-
setTarget
public void setTarget(File target)
-
getTargetName
public String getTargetName()
-
setTargetName
public void setTargetName(String targetName)
-
getCurrentOutputFile
public OutputFile getCurrentOutputFile()
-
setCurrentOutputFile
public void setCurrentOutputFile(OutputFile currentOutputFile)
-
getExistingContents
public String getExistingContents()
-
setExistingContents
public void setExistingContents(String existingContents)
-
getNewContents
public String getNewContents()
-
setNewContents
public void setNewContents(String newContents)
-
getPositiveMessage
public String getPositiveMessage()
-
setPositiveMessage
public void setPositiveMessage(String positiveMessage)
-
getOutputMode
public EglFileGeneratingTemplate.OutputMode getOutputMode()
-
setOutputMode
public void setOutputMode(EglFileGeneratingTemplate.OutputMode outputMode)
-
-