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(java.net.URI path, IEglContext context, java.net.URI outputRoot)
EglFileGeneratingTemplate(EglTemplateSpecification spec, IEglContext context, java.net.URI outputRoot)
EglFileGeneratingTemplate(EglTemplateSpecification spec, IEglContext context, java.net.URI outputRoot, java.lang.String outputRootPath)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
addProtectedRegionWarning(ProtectedRegionWarning warning)
java.io.File
append(java.lang.String path)
protected void
doGenerate(java.io.File target, java.lang.String targetName, boolean overwrite, boolean merge)
Store result of processing template in the given file.OutputFile
getCurrentOutputFile()
java.lang.String
getExistingContents()
java.lang.String
getNewContents()
EglFileGeneratingTemplate.OutputMode
getOutputMode()
java.lang.String
getPositiveMessage()
java.io.File
getTarget()
java.lang.String
getTargetName()
protected boolean
isOverwriteUnchangedFiles()
java.io.File
patch(java.lang.String path)
protected void
prepareNewContents()
void
setCurrentOutputFile(OutputFile currentOutputFile)
void
setExistingContents(java.lang.String existingContents)
void
setNewContents(java.lang.String newContents)
void
setOutputMode(EglFileGeneratingTemplate.OutputMode outputMode)
void
setPositiveMessage(java.lang.String positiveMessage)
void
setTarget(java.io.File target)
void
setTargetName(java.lang.String targetName)
protected void
write()
protected java.io.File
write(java.lang.String path, EglFileGeneratingTemplate.OutputMode outputMode)
protected void
writeNewContentsIfDifferentFromExistingContents()
-
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(java.net.URI path, IEglContext context, java.net.URI outputRoot) throws java.lang.Exception
- Throws:
java.lang.Exception
-
EglFileGeneratingTemplate
public EglFileGeneratingTemplate(EglTemplateSpecification spec, IEglContext context, java.net.URI outputRoot, java.lang.String outputRootPath) throws java.lang.Exception
- Throws:
java.lang.Exception
-
EglFileGeneratingTemplate
public EglFileGeneratingTemplate(EglTemplateSpecification spec, IEglContext context, java.net.URI outputRoot) throws java.lang.Exception
- Parameters:
spec
-context
-outputRoot
-- Throws:
java.lang.Exception
- Since:
- 1.6
-
-
Method Detail
-
append
public java.io.File append(java.lang.String path) throws EglRuntimeException
- Throws:
EglRuntimeException
-
patch
public java.io.File patch(java.lang.String path) throws EglRuntimeException
- Throws:
EglRuntimeException
-
write
protected java.io.File write(java.lang.String path, EglFileGeneratingTemplate.OutputMode outputMode) throws EglRuntimeException
- Throws:
EglRuntimeException
-
doGenerate
protected void doGenerate(java.io.File target, java.lang.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 java.net.URISyntaxException, java.io.IOException
- Throws:
java.net.URISyntaxException
java.io.IOException
-
isOverwriteUnchangedFiles
protected boolean isOverwriteUnchangedFiles()
-
write
protected void write() throws java.io.IOException, java.net.URISyntaxException
- Throws:
java.io.IOException
java.net.URISyntaxException
-
addProtectedRegionWarning
protected void addProtectedRegionWarning(ProtectedRegionWarning warning)
- Overrides:
addProtectedRegionWarning
in classEglTemplate
-
getTarget
public java.io.File getTarget()
-
setTarget
public void setTarget(java.io.File target)
-
getTargetName
public java.lang.String getTargetName()
-
setTargetName
public void setTargetName(java.lang.String targetName)
-
getCurrentOutputFile
public OutputFile getCurrentOutputFile()
-
setCurrentOutputFile
public void setCurrentOutputFile(OutputFile currentOutputFile)
-
getExistingContents
public java.lang.String getExistingContents()
-
setExistingContents
public void setExistingContents(java.lang.String existingContents)
-
getNewContents
public java.lang.String getNewContents()
-
setNewContents
public void setNewContents(java.lang.String newContents)
-
getPositiveMessage
public java.lang.String getPositiveMessage()
-
setPositiveMessage
public void setPositiveMessage(java.lang.String positiveMessage)
-
getOutputMode
public EglFileGeneratingTemplate.OutputMode getOutputMode()
-
setOutputMode
public void setOutputMode(EglFileGeneratingTemplate.OutputMode outputMode)
-
-