Class ExtensionContext
- java.lang.Object
-
- org.smooks.engine.resource.config.loader.xml.extension.ExtensionContext
-
public class ExtensionContext extends Object
Context object used by Smooks configuration extension visitors.- Author:
- tom.fennelly@gmail.com
-
-
Field Summary
Fields Modifier and Type Field Description static TypedKey<ExtensionContext>
EXTENSION_CONTEXT_TYPED_KEY
-
Constructor Summary
Constructors Constructor Description ExtensionContext(XmlResourceConfigLoader xmlResourceConfigLoader, String defaultProfile, ExpressionEvaluator defaultConditionEvaluator)
Public constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addResourceConfig(ResourceConfig resourceConfig)
Add a resource configuration to the list of resources for this Extension Context.void
addResourceTemplate(ResourceConfig resourceConfig)
Add a resource configuration template to the resources stack for this Extension Context.ExpressionEvaluator
getDefaultConditionEvaluator()
String
getDefaultProfile()
ResourceConfig
getResourceConfigsByName(String name)
List<ResourceConfig>
getResources()
Get the resource list.Stack<ResourceConfig>
getResourceStack()
Get the resource stack.XmlResourceConfigLoader
getXmlResourceConfigLoader()
List<ResourceConfig>
lookupResourceConfigs(ConfigSearch searchCriteria)
Lookup an existing resource configuration from the global config list.
-
-
-
Field Detail
-
EXTENSION_CONTEXT_TYPED_KEY
public static final TypedKey<ExtensionContext> EXTENSION_CONTEXT_TYPED_KEY
-
-
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 theresourceStack
and the basic list ofresources
.- 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.
-
getResourceStack
public Stack<ResourceConfig> getResourceStack()
Get the resource stack.- Returns:
- The resource stack.
- See Also:
addResourceConfig(ResourceConfig)
-
getResources
public List<ResourceConfig> getResources()
Get the resource list.- Returns:
- The resource list.
- See Also:
addResourceConfig(ResourceConfig)
-
getXmlResourceConfigLoader
public XmlResourceConfigLoader getXmlResourceConfigLoader()
-
getDefaultProfile
public String getDefaultProfile()
-
getDefaultConditionEvaluator
public ExpressionEvaluator getDefaultConditionEvaluator()
-
getResourceConfigsByName
public ResourceConfig getResourceConfigsByName(String name)
-
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.
-
-