Package org.smooks.api
Interface ExecutionContext
-
- All Superinterfaces:
TypedMap
- All Known Implementing Classes:
DefaultExecutionContext
@NotThreadSafe public interface ExecutionContext extends TypedMap
Runtime context of a filter execution.
-
-
Field Summary
Fields Modifier and Type Field Description static URI
DOCUMENT_URI
Sometimes the document being transformed/analysed has a URI associated with it.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description ApplicationContext
getApplicationContext()
Gets theApplicationContext
of thisExecutionContext
.BeanContext
getBeanContext()
Gets theBeanContext
for thisExecutionContext
.String
getConfigParameter(String name)
Get a global configuration parameter associated with this execution context.String
getConfigParameter(String name, String defaultVal)
Get a global configuration parameter associated with this execution context.ContentDeliveryRuntime
getContentDeliveryRuntime()
Get the content delivery configuration for the profile set at which this context is targeted.String
getContentEncoding()
Get the content encoding to be used when parsing content on this context.URI
getDocumentSource()
Gets the document source URI of thisExecutionContext
.MementoCaretaker
getMementoCaretaker()
ProfileSet
getTargetProfiles()
Gets the set of profiles at which this execution context is targeted.Throwable
getTerminationError()
Set the error/exception that caused the filter operation associated with this ExecutionContext to terminate.void
setBeanContext(BeanContext beanContext)
Sets theBeanContext
for thisExecutionContext
.void
setContentEncoding(String contentEncoding)
Set the content encoding to be used when parsing content on this context.void
setDocumentSource(URI docSource)
Sets the document source URI of thisExecutionContext
.void
setTerminationError(Throwable terminationError)
Set the error/exception that caused the filter operation associated with this ExecutionContext to terminate.
-
-
-
Field Detail
-
DOCUMENT_URI
static final URI DOCUMENT_URI
Sometimes the document being transformed/analysed has a URI associated with it. This can be bound to the execution context under this key.
-
-
Method Detail
-
setDocumentSource
void setDocumentSource(URI docSource)
Sets the document source URI of thisExecutionContext
.- Parameters:
docSource
- the document URI
-
getDocumentSource
URI getDocumentSource()
Gets the document source URI of thisExecutionContext
. If the document source URI is not set for the context, implementations should return theDOCUMENT_URI
constant.- Returns:
- the document URI.
-
getApplicationContext
ApplicationContext getApplicationContext()
Gets theApplicationContext
of thisExecutionContext
.- Returns:
- the
ApplicationContext
instance.
-
getTargetProfiles
ProfileSet getTargetProfiles()
Gets the set of profiles at which this execution context is targeted. Basically, the set of profiles for which this execution context is to perform transformation/analysis.- Returns:
- the target
ProfileSet
.
-
getContentDeliveryRuntime
ContentDeliveryRuntime getContentDeliveryRuntime()
Get the content delivery configuration for the profile set at which this context is targeted.- Returns:
- ContentDeliveryConfig instance.
-
setContentEncoding
void setContentEncoding(String contentEncoding) throws IllegalArgumentException
Set the content encoding to be used when parsing content on this context.- Parameters:
contentEncoding
- Character encoding to be used when parsing content. Null defaults to "UTF-8".- Throws:
IllegalArgumentException
- Invalid encoding.
-
getContentEncoding
String getContentEncoding()
Get the content encoding to be used when parsing content on this context.- Returns:
- Character encoding to be used when parsing content. Defaults to "UTF-8".
-
setTerminationError
void setTerminationError(Throwable terminationError)
Set the error/exception that caused the filter operation associated with this ExecutionContext to terminate.- Parameters:
terminationError
- The termination Error/Exception.
-
getTerminationError
Throwable getTerminationError()
Set the error/exception that caused the filter operation associated with this ExecutionContext to terminate.- Returns:
- The Error/Exception that caused the associated filter operation to terminate (if it did terminate), otherwise null.
-
getConfigParameter
String getConfigParameter(String name)
Get a global configuration parameter associated with this execution context. For more fine grained control, see theParameterAccessor
class.- Parameters:
name
- The name of the parameter.- Returns:
- The parameter value, or null if the parameter is not configured.
-
getConfigParameter
String getConfigParameter(String name, String defaultVal)
Get a global configuration parameter associated with this execution context. For more fine grained control, see theParameterAccessor
class.- Parameters:
name
- The name of the parameter.defaultVal
- The default value to be returned if the configuration parameter is not set.- Returns:
- The parameter value, or "defaultVal" if the parameter is not configured.
-
getBeanContext
BeanContext getBeanContext()
Gets theBeanContext
for thisExecutionContext
.- Returns:
- the
BeanContext
-
setBeanContext
void setBeanContext(BeanContext beanContext)
Sets theBeanContext
for thisExecutionContext
.- Parameters:
beanContext
- theBeanContext
-
getMementoCaretaker
MementoCaretaker getMementoCaretaker()
- Returns:
- the
MementoCaretaker
for thisExecutionContext
-
-