Package org.eclipse.epsilon.egl
Class EglPersistentTemplate
java.lang.Object
org.eclipse.epsilon.egl.EglTemplate
org.eclipse.epsilon.egl.EglPersistentTemplate
- Direct Known Subclasses:
EglFileGeneratingTemplate
-
Field Summary
FieldsFields inherited from class org.eclipse.epsilon.egl.EglTemplate
listeners, module, name, template
-
Constructor Summary
ConstructorsConstructorDescriptionEglPersistentTemplate
(EglTemplateSpecification spec, IEglContext context, URI outputRoot) EglPersistentTemplate
(EglTemplateSpecification spec, IEglContext context, URI outputRoot, String outputRootPath) -
Method Summary
Modifier and TypeMethodDescriptionprotected void
addMessage
(String message) protected abstract void
doGenerate
(File file, String targetName, boolean overwrite, boolean merge) Store result of processing template in the given file.final void
The preferred way of generating code from a persistent template, this stores the generation result in the given file, maintaining any protected regions.Fully parameterised version of generate, usually only used internally.protected String
protected File
resolveFile
(String path) void
Deprecated.Use generate(path) instead, or generate(path, false, false), if you really know what you are doing :-)void
Deprecated.Use generate(path) instead, or generate(path, overwrite, false), if you really know what you are doing :-)Methods inherited from class org.eclipse.epsilon.egl.EglTemplate
addProtectedRegionWarning, getContents, getDeclaredModelDefinitions, getDeclaredOperations, getFormatter, getImports, getIncrementalitySettings, getModelDefinitions, getModule, getName, getOperations, getParseProblems, getTemplate, isProcessed, merge, populate, printWarning, process, reset, setFormatter, setFormatters, setFormatters, setIncrementalitySettings
-
Field Details
-
outputRoot
-
outputRootPath
-
-
Constructor Details
-
EglPersistentTemplate
public EglPersistentTemplate(EglTemplateSpecification spec, IEglContext context, URI outputRoot) throws Exception - Parameters:
spec
-context
-outputRoot
-- Throws:
Exception
- Since:
- 1.6
-
EglPersistentTemplate
public EglPersistentTemplate(EglTemplateSpecification spec, IEglContext context, URI outputRoot, String outputRootPath) throws Exception - Throws:
Exception
-
-
Method Details
-
resolveFile
- Throws:
EglRuntimeException
-
store
Deprecated.Use generate(path) instead, or generate(path, false, false), if you really know what you are doing :-)This processes the template and stores the result in the given file, provided that this file does not exist yet. This method is here for backward compatibility only.- Parameters:
path
-- Throws:
EglRuntimeException
-
store
Deprecated.Use generate(path) instead, or generate(path, overwrite, false), if you really know what you are doing :-)This processes the template and stores the result in the given file. If overwrite is false, an existing file will prevent the result from being written. If overwrite is true, any existing file will be overwritten, not respecting protected regions. This method is here for backward compatibility only.- Parameters:
path
-overwrite
-- Throws:
EglRuntimeException
-
generate
The preferred way of generating code from a persistent template, this stores the generation result in the given file, maintaining any protected regions.- Parameters:
path
-- Throws:
EglRuntimeException
-
generate
Fully parameterised version of generate, usually only used internally. Setting overwrite to false implies merge is ignored.- Parameters:
path
-overwrite
-merge
-- Returns:
- The output file.
- Throws:
EglRuntimeException
-
name
-
doGenerate
protected abstract void doGenerate(File file, String targetName, boolean overwrite, boolean merge) throws EglRuntimeException 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
.- Parameters:
path
-targetName
-overwrite
-merge
-- Throws:
EglRuntimeException
-
addMessage
-