Class 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 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:
        setDocumentSource in interface org.smooks.api.ExecutionContext
      • getDocumentSource

        public URI getDocumentSource()
        Specified by:
        getDocumentSource in interface org.smooks.api.ExecutionContext
      • getApplicationContext

        public org.smooks.api.ApplicationContext getApplicationContext()
        Specified by:
        getApplicationContext in interface org.smooks.api.ExecutionContext
      • getTargetProfiles

        public org.smooks.api.profile.ProfileSet getTargetProfiles()
        Specified by:
        getTargetProfiles in interface org.smooks.api.ExecutionContext
      • getContentDeliveryRuntime

        public org.smooks.api.delivery.ContentDeliveryRuntime getContentDeliveryRuntime()
        Specified by:
        getContentDeliveryRuntime in interface org.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:
        setContentEncoding in interface org.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:
        getContentEncoding in interface org.smooks.api.ExecutionContext
        Returns:
        Character encoding to be used when parsing content. Defaults to "UTF-8".
      • setTerminationError

        public void setTerminationError​(Throwable terminationError)
        Specified by:
        setTerminationError in interface org.smooks.api.ExecutionContext
      • getTerminationError

        public Throwable getTerminationError()
        Specified by:
        getTerminationError in interface org.smooks.api.ExecutionContext
      • getConfigParameter

        public String getConfigParameter​(String name)
        Specified by:
        getConfigParameter in interface org.smooks.api.ExecutionContext
      • getConfigParameter

        public String getConfigParameter​(String name,
                                         String defaultVal)
        Specified by:
        getConfigParameter in interface org.smooks.api.ExecutionContext
      • put

        public <T> void put​(org.smooks.api.TypedKey<T> key,
                            T value)
        Specified by:
        put in interface org.smooks.api.TypedMap
      • get

        public <T> T get​(org.smooks.api.TypedKey<T> key)
        Specified by:
        get in interface org.smooks.api.TypedMap
      • getOrDefault

        public <T> T getOrDefault​(org.smooks.api.TypedKey<T> key,
                                  T value)
        Specified by:
        getOrDefault in interface org.smooks.api.TypedMap
      • remove

        public <T> void remove​(org.smooks.api.TypedKey<T> key)
        Specified by:
        remove in interface org.smooks.api.TypedMap
      • getAll

        public Map<org.smooks.api.TypedKey<Object>,​Object> getAll()
        Specified by:
        getAll in interface org.smooks.api.TypedMap
      • getBeanContext

        public org.smooks.api.bean.context.BeanContext getBeanContext()
        Specified by:
        getBeanContext in interface org.smooks.api.ExecutionContext
      • setBeanContext

        public void setBeanContext​(org.smooks.api.bean.context.BeanContext beanContext)
        Specified by:
        setBeanContext in interface org.smooks.api.ExecutionContext
      • getMementoCaretaker

        public org.smooks.api.memento.MementoCaretaker getMementoCaretaker()
        Specified by:
        getMementoCaretaker in interface org.smooks.api.ExecutionContext