public class EglTemplateFactory extends Object
Modifier and Type | Field and Description |
---|---|
protected IEglContext |
context |
protected URI |
root |
Constructor and Description |
---|
EglTemplateFactory() |
EglTemplateFactory(IEglContext context) |
Modifier and Type | Method and Description |
---|---|
void |
copyState(IEolContext delegate) |
protected EglTemplate |
createTemplate(EglTemplateSpecification spec)
Creates a template from the given specification.
|
IEglContext |
getContext() |
protected IEglContext |
getContextForNewTemplate()
This method should be called when creating a new template from
createTemplate(EglTemplateSpecification) . |
IncrementalitySettings |
getDefaultIncrementalitySettings() |
Collection<ITemplateExecutionListener> |
getTemplateExecutionListeners() |
String |
getTemplateRoot() |
protected EglTemplate |
handleFailedLoad(String name,
Exception e) |
boolean |
initialiseRoot(URI root)
Sets the root of this template factory, unless it has already been set.
|
protected EglTemplate |
load(EglTemplateSpecification spec)
Loads an EglTemplate from the given EglTemplateSpecification.
|
EglTemplate |
load(File file)
Loads an EglTemplate for the EGL code stored in the indicated file.
|
EglTemplate |
load(String path)
Loads an EglTemplate for the EGL code stored in the file at path.
|
protected EglTemplate |
load(String code,
File file)
Loads an EglTemplate for the given EGL code as though it were
contained in the given File.
|
protected EglTemplate |
load(String code,
URI resource)
Loads an EglTemplate for the given EGL code as though it were
contained in the given URI.
|
EglTemplate |
load(URI resource)
Loads an EglTemplate for the EGL code stored in the given resource.
|
protected String |
name(String path) |
EglTemplate |
prepare(String code)
Prepares an EGL template that will execute the given
EGL source code.
|
protected URI |
resolveRoot(String path) |
URI |
resolveTemplate(String path) |
void |
setContext(IEglContext context) |
void |
setDefaultFormatter(Formatter defaultFormatter) |
void |
setDefaultFormatters(Collection<Formatter> defaultFormatters) |
void |
setDefaultFormatters(Formatter... defaultFormatters) |
void |
setRoot(URI root) |
void |
setTemplateRoot(String path) |
String |
toString() |
protected IEglContext context
protected URI root
public EglTemplateFactory()
public EglTemplateFactory(IEglContext context)
public Collection<ITemplateExecutionListener> getTemplateExecutionListeners()
public IncrementalitySettings getDefaultIncrementalitySettings()
public void setDefaultFormatter(Formatter defaultFormatter)
public void setDefaultFormatters(Formatter... defaultFormatters)
public void setDefaultFormatters(Collection<Formatter> defaultFormatters)
public IEglContext getContext()
public void setContext(IEglContext context)
public boolean initialiseRoot(URI root)
root
- The new root.true
if the root was set as a result of this call,
false
if the root had already been initialized.public void setRoot(URI root)
public String getTemplateRoot()
public void setTemplateRoot(String path) throws EglRuntimeException
EglRuntimeException
protected URI resolveRoot(String path) throws EglRuntimeException
EglRuntimeException
public URI resolveTemplate(String path) throws EglRuntimeException
EglRuntimeException
public EglTemplate load(File file) throws EglRuntimeException
#createTemplate(String, URI)
, rather
than this method, unless they wish to alter the way in which a file is
transformed into an EglTemplateSpecificationEglRuntimeException
protected EglTemplate load(String code, File file) throws EglRuntimeException
#createTemplate(String, URI)
, rather
than this method, unless they wish to alter the way in which a dirty
resource is transformed into an EglTemplateSpecificationEglRuntimeException
public EglTemplate load(String path) throws EglRuntimeException
#createTemplate(String, URI)
, rather
than this method, unless they wish to alter the way in which a path is
transformed into an EglTemplateSpecificationEglRuntimeException
public EglTemplate load(URI resource) throws EglRuntimeException
#createTemplate(String, URI)
, rather
than this method, unless they wish to alter the way in which a resource is
transformed into an EglTemplateSpecificationEglRuntimeException
protected EglTemplate load(String code, URI resource) throws EglRuntimeException
#createTemplate(String, URI)
, rather
than this method, unless they wish to alter the way in which a dirty
resource is transformed into an EglTemplateSpecificationEglRuntimeException
protected final EglTemplate load(EglTemplateSpecification spec) throws EglRuntimeException
#createTemplate(String, URI)
, rather
than this method, unless they wish to alter the way in which IOExceptions
are handled, in which case they should override handleFailedLoad(String, Exception)
.EglRuntimeException
protected EglTemplate handleFailedLoad(String name, Exception e) throws EglRuntimeException
EglRuntimeException
public final EglTemplate prepare(String code) throws Exception
#createTemplate(String)
, rather than this method,
as this method may, in the future, acquire additional
responsibilities, such as exception handling.Exception
protected EglTemplate createTemplate(EglTemplateSpecification spec) throws Exception
Exception
public void copyState(IEolContext delegate)
protected IEglContext getContextForNewTemplate()
createTemplate(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.Copyright © 2020. All rights reserved.