Class DefaultExecutionContext

    • Constructor Detail

      • DefaultExecutionContext

        public DefaultExecutionContext​(String targetProfile,
                                       ApplicationContext applicationContext,
                                       List<ContentHandlerBinding<Visitor>> extendedContentHandlerBindings)
                                throws 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:
        UnknownProfileMemberException - Unknown target profile.
      • DefaultExecutionContext

        public DefaultExecutionContext​(String targetProfile,
                                       ApplicationContext applicationContext,
                                       String contentEncoding,
                                       List<ContentHandlerBinding<Visitor>> extendedContentHandlerBindings)
                                throws 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:
        UnknownProfileMemberException - Unknown target profile.
    • Method Detail

      • setDocumentSource

        public void setDocumentSource​(URI docSource)
        Description copied from interface: ExecutionContext
        Sets the document source URI of this ExecutionContext.
        Specified by:
        setDocumentSource in interface ExecutionContext
        Parameters:
        docSource - the document URI
      • getTargetProfiles

        public ProfileSet getTargetProfiles()
        Description copied from interface: ExecutionContext
        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.

        Specified by:
        getTargetProfiles in interface ExecutionContext
        Returns:
        the target ProfileSet.
      • getContentEncoding

        public String getContentEncoding()
        Get the content encoding to be used when parsing content on this standalone request instance.
        Specified by:
        getContentEncoding in interface ExecutionContext
        Returns:
        Character encoding to be used when parsing content. Defaults to "UTF-8".
      • setTerminationError

        public void setTerminationError​(Throwable terminationError)
        Description copied from interface: ExecutionContext
        Set the error/exception that caused the filter operation associated with this ExecutionContext to terminate.
        Specified by:
        setTerminationError in interface ExecutionContext
        Parameters:
        terminationError - The termination Error/Exception.
      • getTerminationError

        public Throwable getTerminationError()
        Description copied from interface: ExecutionContext
        Set the error/exception that caused the filter operation associated with this ExecutionContext to terminate.
        Specified by:
        getTerminationError in interface ExecutionContext
        Returns:
        The Error/Exception that caused the associated filter operation to terminate (if it did terminate), otherwise null.
      • getConfigParameter

        public String getConfigParameter​(String name)
        Description copied from interface: ExecutionContext
        Get a global configuration parameter associated with this execution context.

        For more fine grained control, see the ParameterAccessor class.

        Specified by:
        getConfigParameter in interface ExecutionContext
        Parameters:
        name - The name of the parameter.
        Returns:
        The parameter value, or null if the parameter is not configured.
      • getConfigParameter

        public String getConfigParameter​(String name,
                                         String defaultVal)
        Description copied from interface: ExecutionContext
        Get a global configuration parameter associated with this execution context.

        For more fine grained control, see the ParameterAccessor class.

        Specified by:
        getConfigParameter in interface ExecutionContext
        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.
      • put

        public <T> void put​(TypedKey<T> key,
                            T value)
        Description copied from interface: TypedMap
        Associates the specified value with the specified key in this map. If the map previously contained a mapping for the key, the old value is replaced.
        Specified by:
        put in interface TypedMap
        Type Parameters:
        T - type of key and value
        Parameters:
        key - key with which the specified value is to be associated
        value - value to be associated with the specified key
      • get

        public <T> T get​(TypedKey<T> key)
        Description copied from interface: TypedMap
        Returns the value to which the specified key is mapped, or null if this map contains no mapping for the key.

        More formally, if this map contains a mapping from a key k to a value v such that (key==null ? k==null : key.equals(k)), then this method returns v; otherwise it returns null. (There can be at most one such mapping.)

        A return value of null does not necessarily indicate that the map contains no mapping for the key; it's also possible that the map explicitly maps the key to null.

        Specified by:
        get in interface TypedMap
        Type Parameters:
        T - type of key
        Parameters:
        key - key for the value to return
        Returns:
        the value associated with key, or null if there was no mapping for key. (A null return can also indicate that the map previously associated null with key.)
      • getOrDefault

        public <T> T getOrDefault​(TypedKey<T> key,
                                  T value)
        Description copied from interface: TypedMap
        Returns the value to which the specified key is mapped, or defaultValue if this map contains no mapping for the key.
        Specified by:
        getOrDefault in interface TypedMap
        Type Parameters:
        T - type of key and value
        Parameters:
        key - key whose associated value is to be returned
        value - default mapping of the key
        Returns:
        value to which the specified key is mapped, or defaultValue if this map contains no mapping for the key
      • remove

        public <T> void remove​(TypedKey<T> key)
        Description copied from interface: TypedMap
        Removes the mapping for a key from this map if it is present (optional operation). More formally, if this map contains a mapping from key k to value v such that (key==null ? k==null : key.equals(k)), that mapping is removed. (The map can contain at most one such mapping.)

        Returns the value to which this map previously associated the key, or null if the map contained no mapping for the key.

        If this map permits null values, then a return value of null does not necessarily indicate that the map contained no mapping for the key; it's also possible that the map explicitly mapped the key to null.

        The map will not contain a mapping for the specified key once the call returns.

        Specified by:
        remove in interface TypedMap
        Parameters:
        key - key whose mapping is to be removed from the map