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 URIDOCUMENT_URISometimes the document being transformed/analysed has a URI associated with it.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description ApplicationContextgetApplicationContext()Gets theApplicationContextof thisExecutionContext.BeanContextgetBeanContext()Gets theBeanContextfor thisExecutionContext.StringgetConfigParameter(String name)Get a global configuration parameter associated with this execution context.StringgetConfigParameter(String name, String defaultVal)Get a global configuration parameter associated with this execution context.ContentDeliveryRuntimegetContentDeliveryRuntime()Get the content delivery configuration for the profile set at which this context is targeted.StringgetContentEncoding()Get the content encoding to be used when parsing content on this context.URIgetDocumentSource()Gets the document source URI of thisExecutionContext.MementoCaretakergetMementoCaretaker()ProfileSetgetTargetProfiles()Gets the set of profiles at which this execution context is targeted.ThrowablegetTerminationError()Set the error/exception that caused the filter operation associated with this ExecutionContext to terminate.voidsetBeanContext(BeanContext beanContext)Sets theBeanContextfor thisExecutionContext.voidsetContentEncoding(String contentEncoding)Set the content encoding to be used when parsing content on this context.voidsetDocumentSource(URI docSource)Sets the document source URI of thisExecutionContext.voidsetTerminationError(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_URIconstant.- Returns:
- the document URI.
-
getApplicationContext
ApplicationContext getApplicationContext()
Gets theApplicationContextof thisExecutionContext.- Returns:
- the
ApplicationContextinstance.
-
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 theParameterAccessorclass.- 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 theParameterAccessorclass.- 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 theBeanContextfor thisExecutionContext.- Returns:
- the
BeanContext
-
setBeanContext
void setBeanContext(BeanContext beanContext)
Sets theBeanContextfor thisExecutionContext.- Parameters:
beanContext- theBeanContext
-
getMementoCaretaker
MementoCaretaker getMementoCaretaker()
- Returns:
- the
MementoCaretakerfor thisExecutionContext
-
-