Package com.consol.citrus.xml.namespace
Class NamespaceContextBuilder
- java.lang.Object
-
- com.consol.citrus.xml.namespace.NamespaceContextBuilder
-
public class NamespaceContextBuilder extends Object
Builds a namespace context for XPath expression evaluations. Builder supports default mappings as well as dynamic mappings from received message. Namespace mappings are defined as key value pairs where key is definded as namespace prefix and value is the actual namespace uri.- Author:
- Christoph Deppisch
-
-
Field Summary
Fields Modifier and Type Field Description static StringDEFAULT_BEAN_IDThe default bean id in Spring application context
-
Constructor Summary
Constructors Constructor Description NamespaceContextBuilder()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description NamespaceContextbuildContext(Message receivedMessage, Map<String,String> namespaces)Construct a basic namespace context from the received message and explicit namespace mappings.Map<String,String>getNamespaceMappings()Gets the namespaceMappings.static Map<String,String>lookupNamespaces(String xml)Look up namespace attribute declarations in the XML fragment and store them in a binding map, where the key is the namespace prefix and the value is the namespace uri.voidsetNamespaceMappings(Map<String,String> defaultMappings)Sets the default mappings for this namespace context builder.
-
-
-
Field Detail
-
DEFAULT_BEAN_ID
public static final String DEFAULT_BEAN_ID
The default bean id in Spring application context- See Also:
- Constant Field Values
-
-
Method Detail
-
buildContext
public NamespaceContext buildContext(Message receivedMessage, Map<String,String> namespaces)
Construct a basic namespace context from the received message and explicit namespace mappings.- Parameters:
receivedMessage- the actual message received.namespaces- explicit namespace mappings for this construction.- Returns:
- the constructed namespace context.
-
setNamespaceMappings
public void setNamespaceMappings(Map<String,String> defaultMappings)
Sets the default mappings for this namespace context builder.- Parameters:
defaultMappings- the defaultMappings to set
-
getNamespaceMappings
public Map<String,String> getNamespaceMappings()
Gets the namespaceMappings.- Returns:
- the namespaceMappings the namespaceMappings to get.
-
lookupNamespaces
public static Map<String,String> lookupNamespaces(String xml)
Look up namespace attribute declarations in the XML fragment and store them in a binding map, where the key is the namespace prefix and the value is the namespace uri.- Parameters:
xml- XML fragment.- Returns:
- map containing namespace prefix - namespace uri pairs.
-
-