Class ExtensionContext


  • public class ExtensionContext
    extends Object
    Context object used by Smooks configuration extension visitors.
    Author:
    tom.fennelly@gmail.com
    • Constructor Detail

      • ExtensionContext

        public ExtensionContext​(XmlResourceConfigLoader xmlResourceConfigLoader,
                                String defaultProfile,
                                ExpressionEvaluator defaultConditionEvaluator)
        Public constructor.
        Parameters:
        xmlResourceConfigLoader - The base XMLConfigDigester.
        defaultProfile - The default profile.
        defaultConditionEvaluator - The default condition evaluator.
    • Method Detail

      • addResourceConfig

        public void addResourceConfig​(ResourceConfig resourceConfig)
        Add a resource configuration to the list of resources for this Extension Context.

        The resource gets added to the resourceStack and the basic list of resources.

        Parameters:
        resourceConfig - The resource to be added.
      • addResourceTemplate

        public void addResourceTemplate​(ResourceConfig resourceConfig)
        Add a resource configuration template to the resources stack for this Extension Context.

        This resource is not added as a resource on the Smooks instance, but is instead available for cloning.

        Parameters:
        resourceConfig - The resource to be added.
      • getDefaultProfile

        public String getDefaultProfile()
      • lookupResourceConfigs

        public List<ResourceConfig> lookupResourceConfigs​(ConfigSearch searchCriteria)
        Lookup an existing resource configuration from the global config list.

        Note that this is resource config order-dependent. It will not locate configs that have not yet been loaded.

        Parameters:
        searchCriteria - The resource lookup criteria.
        Returns:
        List of matches resources, or an empty List if no matches are found.