Package org.smooks.engine
Class DefaultExecutionContext
- java.lang.Object
-
- org.smooks.engine.DefaultExecutionContext
-
- All Implemented Interfaces:
org.smooks.api.ExecutionContext,org.smooks.api.TypedMap
public class DefaultExecutionContext extends Object implements org.smooks.api.ExecutionContext
Standalone Container Request implementation.- Author:
- tfennelly
-
-
Constructor Summary
Constructors Constructor Description DefaultExecutionContext(String targetProfile, org.smooks.api.ApplicationContext applicationContext, String contentEncoding, List<org.smooks.api.delivery.ContentHandlerBinding<org.smooks.api.resource.visitor.Visitor>> extendedContentHandlerBindings)Public Constructor.DefaultExecutionContext(String targetProfile, org.smooks.api.ApplicationContext applicationContext, List<org.smooks.api.delivery.ContentHandlerBinding<org.smooks.api.resource.visitor.Visitor>> extendedContentHandlerBindings)Public Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <T> Tget(org.smooks.api.TypedKey<T> key)Map<org.smooks.api.TypedKey<Object>,Object>getAll()org.smooks.api.ApplicationContextgetApplicationContext()org.smooks.api.bean.context.BeanContextgetBeanContext()StringgetConfigParameter(String name)StringgetConfigParameter(String name, String defaultVal)org.smooks.api.delivery.ContentDeliveryRuntimegetContentDeliveryRuntime()StringgetContentEncoding()Get the content encoding to be used when parsing content on this standalone request instance.URIgetDocumentSource()org.smooks.api.memento.MementoCaretakergetMementoCaretaker()<T> TgetOrDefault(org.smooks.api.TypedKey<T> key, T value)org.smooks.api.profile.ProfileSetgetTargetProfiles()ThrowablegetTerminationError()<T> voidput(org.smooks.api.TypedKey<T> key, T value)<T> voidremove(org.smooks.api.TypedKey<T> key)voidsetBeanContext(org.smooks.api.bean.context.BeanContext beanContext)voidsetContentEncoding(String contentEncoding)Set the content encoding to be used when parsing content on this standalone request instance.voidsetDocumentSource(URI docSource)voidsetTerminationError(Throwable terminationError)StringtoString()
-
-
-
Constructor Detail
-
DefaultExecutionContext
public DefaultExecutionContext(String targetProfile, org.smooks.api.ApplicationContext applicationContext, List<org.smooks.api.delivery.ContentHandlerBinding<org.smooks.api.resource.visitor.Visitor>> extendedContentHandlerBindings) throws org.smooks.api.profile.UnknownProfileMemberException
Public Constructor. The execution context is constructed within the context of a target profile and application context.- Parameters:
targetProfile- The target base profile for the execution context. These parameters are not appended to the supplied requestURI. This arg must be supplied, even if it's empty.applicationContext- The application context.extendedContentHandlerBindings- Preconfigured/extended Visitor Configuration Map.- Throws:
org.smooks.api.profile.UnknownProfileMemberException- Unknown target profile.
-
DefaultExecutionContext
public DefaultExecutionContext(String targetProfile, org.smooks.api.ApplicationContext applicationContext, String contentEncoding, List<org.smooks.api.delivery.ContentHandlerBinding<org.smooks.api.resource.visitor.Visitor>> extendedContentHandlerBindings) throws org.smooks.api.profile.UnknownProfileMemberException
Public Constructor. The execution context is constructed within the context of a target profile and application context.- Parameters:
targetProfile- The target profile (base profile) for this context. These parameters are not appended to the supplied requestURI. This arg must be supplied, even if it's empty.applicationContext- The application context.contentEncoding- Character encoding to be used when parsing content. Null defaults to "UTF-8".extendedContentHandlerBindings- Preconfigured/extended Visitor Configuration Map.- Throws:
org.smooks.api.profile.UnknownProfileMemberException- Unknown target profile.
-
-
Method Detail
-
setDocumentSource
public void setDocumentSource(URI docSource)
- Specified by:
setDocumentSourcein interfaceorg.smooks.api.ExecutionContext
-
getDocumentSource
public URI getDocumentSource()
- Specified by:
getDocumentSourcein interfaceorg.smooks.api.ExecutionContext
-
getApplicationContext
public org.smooks.api.ApplicationContext getApplicationContext()
- Specified by:
getApplicationContextin interfaceorg.smooks.api.ExecutionContext
-
getTargetProfiles
public org.smooks.api.profile.ProfileSet getTargetProfiles()
- Specified by:
getTargetProfilesin interfaceorg.smooks.api.ExecutionContext
-
getContentDeliveryRuntime
public org.smooks.api.delivery.ContentDeliveryRuntime getContentDeliveryRuntime()
- Specified by:
getContentDeliveryRuntimein interfaceorg.smooks.api.ExecutionContext
-
setContentEncoding
public void setContentEncoding(String contentEncoding) throws IllegalArgumentException
Set the content encoding to be used when parsing content on this standalone request instance.- Specified by:
setContentEncodingin interfaceorg.smooks.api.ExecutionContext- Parameters:
contentEncoding- Character encoding to be used when parsing content. Null defaults to "UTF-8".- Throws:
IllegalArgumentException- Invalid encoding.
-
getContentEncoding
public String getContentEncoding()
Get the content encoding to be used when parsing content on this standalone request instance.- Specified by:
getContentEncodingin interfaceorg.smooks.api.ExecutionContext- Returns:
- Character encoding to be used when parsing content. Defaults to "UTF-8".
-
setTerminationError
public void setTerminationError(Throwable terminationError)
- Specified by:
setTerminationErrorin interfaceorg.smooks.api.ExecutionContext
-
getTerminationError
public Throwable getTerminationError()
- Specified by:
getTerminationErrorin interfaceorg.smooks.api.ExecutionContext
-
getConfigParameter
public String getConfigParameter(String name)
- Specified by:
getConfigParameterin interfaceorg.smooks.api.ExecutionContext
-
getConfigParameter
public String getConfigParameter(String name, String defaultVal)
- Specified by:
getConfigParameterin interfaceorg.smooks.api.ExecutionContext
-
put
public <T> void put(org.smooks.api.TypedKey<T> key, T value)- Specified by:
putin interfaceorg.smooks.api.TypedMap
-
get
public <T> T get(org.smooks.api.TypedKey<T> key)
- Specified by:
getin interfaceorg.smooks.api.TypedMap
-
getOrDefault
public <T> T getOrDefault(org.smooks.api.TypedKey<T> key, T value)- Specified by:
getOrDefaultin interfaceorg.smooks.api.TypedMap
-
remove
public <T> void remove(org.smooks.api.TypedKey<T> key)
- Specified by:
removein interfaceorg.smooks.api.TypedMap
-
getAll
public Map<org.smooks.api.TypedKey<Object>,Object> getAll()
- Specified by:
getAllin interfaceorg.smooks.api.TypedMap
-
getBeanContext
public org.smooks.api.bean.context.BeanContext getBeanContext()
- Specified by:
getBeanContextin interfaceorg.smooks.api.ExecutionContext
-
setBeanContext
public void setBeanContext(org.smooks.api.bean.context.BeanContext beanContext)
- Specified by:
setBeanContextin interfaceorg.smooks.api.ExecutionContext
-
getMementoCaretaker
public org.smooks.api.memento.MementoCaretaker getMementoCaretaker()
- Specified by:
getMementoCaretakerin interfaceorg.smooks.api.ExecutionContext
-
-