Package org.eclipse.epsilon.egl
Class EglTemplateFactory
java.lang.Object
org.eclipse.epsilon.egl.EglTemplateFactory
- Direct Known Subclasses:
EglFileGeneratingTemplateFactory
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
copyState
(IEolContext delegate) protected EglTemplate
Creates a template from the given specification.protected IEglContext
This method should be called when creating a new template fromcreateTemplate(EglTemplateSpecification)
.protected EglTemplate
handleFailedLoad
(String name, Exception e) boolean
initialiseRoot
(URI root) Sets the root of this template factory, unless it has already been set.Loads an EglTemplate for the EGL code stored in the indicated file.Loads an EglTemplate for the EGL code stored in the file at path.protected EglTemplate
Loads an EglTemplate for the given EGL code as though it were contained in the given File.protected EglTemplate
Loads an EglTemplate for the given EGL code as though it were contained in the given URI.Loads an EglTemplate for the EGL code stored in the given resource.protected final EglTemplate
load
(EglTemplateSpecification spec) Loads an EglTemplate from the given EglTemplateSpecification.protected String
final EglTemplate
Prepares an EGL template that will execute the given EGL source code.protected URI
resolveRoot
(String path) resolveTemplate
(String path) void
setContext
(IEglContext context) void
setDefaultFormatter
(Formatter defaultFormatter) void
setDefaultFormatters
(Collection<Formatter> defaultFormatters) void
setDefaultFormatters
(Formatter... defaultFormatters) void
setImportManager
(IImportManager importManager) void
void
setTemplateRoot
(String path) toString()
-
Field Details
-
context
-
root
-
-
Constructor Details
-
EglTemplateFactory
public EglTemplateFactory() -
EglTemplateFactory
-
-
Method Details
-
getTemplateExecutionListeners
-
getDefaultIncrementalitySettings
-
setDefaultFormatter
-
setDefaultFormatters
-
setDefaultFormatters
-
getContext
-
setContext
-
getImportManager
-
setImportManager
-
initialiseRoot
Sets the root of this template factory, unless it has already been set.- Parameters:
root
- The new root.- Returns:
true
if the root was set as a result of this call,false
if the root had already been initialized.
-
setRoot
-
getTemplateRoot
-
setTemplateRoot
- Throws:
EglRuntimeException
-
resolveRoot
- Throws:
EglRuntimeException
-
resolveTemplate
- Throws:
EglRuntimeException
-
name
-
load
Loads an EglTemplate for the EGL code stored in the indicated file. Subclasses should override#createTemplate(String, URI)
, rather than this method, unless they wish to alter the way in which a file is transformed into an EglTemplateSpecification- Throws:
EglRuntimeException
-
load
Loads an EglTemplate for the given EGL code as though it were contained in the given File. Used for parsing "dirty" code (which has not yet been saved to disk). Subclasses should override#createTemplate(String, URI)
, rather than this method, unless they wish to alter the way in which a dirty resource is transformed into an EglTemplateSpecification- Throws:
EglRuntimeException
-
load
Loads an EglTemplate for the EGL code stored in the file at path. Subclasses should override#createTemplate(String, URI)
, rather than this method, unless they wish to alter the way in which a path is transformed into an EglTemplateSpecification- Throws:
EglRuntimeException
-
load
Loads an EglTemplate for the EGL code stored in the given resource. Subclasses should override#createTemplate(String, URI)
, rather than this method, unless they wish to alter the way in which a resource is transformed into an EglTemplateSpecification- Throws:
EglRuntimeException
-
load
Loads an EglTemplate for the given EGL code as though it were contained in the given URI. Used for parsing "dirty" code (which has not yet been saved to disk). Subclasses should override#createTemplate(String, URI)
, rather than this method, unless they wish to alter the way in which a dirty resource is transformed into an EglTemplateSpecification- Throws:
EglRuntimeException
-
load
Loads an EglTemplate from the given EglTemplateSpecification. Subclasses should override#createTemplate(String, URI)
, rather than this method, unless they wish to alter the way in which IOExceptions are handled, in which case they should overridehandleFailedLoad(String, Exception)
.- Throws:
EglRuntimeException
-
handleFailedLoad
- Throws:
EglRuntimeException
-
prepare
Prepares an EGL template that will execute the given EGL source code. Subclasses should override#createTemplate(String)
, rather than this method, as this method may, in the future, acquire additional responsibilities, such as exception handling.- Throws:
Exception
-
createTemplate
Creates a template from the given specification. Subclasses may override to create different types of template.- Throws:
Exception
-
copyState
-
getContextForNewTemplate
This method should be called when creating a new template fromcreateTemplate(EglTemplateSpecification)
. The rationale is that in some cases this factory's context is not safe to be used directly, so a proxy or modifications may be needed instead.- Returns:
- An appropriate context to be used for a new EglTemplate instance.
- Since:
- 1.6
-
toString
-