public class XPathPayloadEndpointMapping extends AbstractMapBasedEndpointMapping implements org.springframework.beans.factory.InitializingBean
EndpointMapping interface that maps to endpoint using an XPath expression. Supports
both mapping to bean instances and mapping to bean names: the latter is required for prototype endpoints.
The XPath expression can be set using the expression property. Setting this property is required. There is
also an optional namespaces property, which defines to set namespace bindings that are used in the
expression.
The endpointMap property is suitable for populating the endpoint map with bean references, e.g. via the map
element in XML bean definitions.
Mappings to bean names can be set via the mappings property, in a form accepted by the
java.util.Properties class, like as follows:
BookFlight=bookFlightEndpoint GetFlights=getFlightsEndpointThe syntax is XPATH_EVALUATION=ENDPOINT_BEAN_NAME. The key is the evaluation of the XPath expression for the incoming message, the value is the name of the endpoint.
setExpression(String),
setNamespaces(java.util.Map)| Constructor and Description |
|---|
XPathPayloadEndpointMapping() |
| Modifier and Type | Method and Description |
|---|---|
void |
afterPropertiesSet() |
protected String |
getLookupKeyForMessage(MessageContext messageContext)
Returns the endpoint key for the given message context.
|
void |
setExpression(String expression)
Sets the XPath expression to be used.
|
void |
setNamespaces(Map<String,String> namespaces)
Sets the namespaces bindings used in the expression.
|
protected boolean |
validateLookupKey(String key)
Validates the given endpoint key.
|
getEndpointInternal, initApplicationContext, lookupEndpoint, registerEndpoint, setEndpointMap, setLazyInitEndpoints, setMappings, setRegisterBeanNamescreateEndpointInvocationChain, getDefaultEndpoint, getEndpoint, getInterceptors, getOrder, initInterceptors, resolveStringEndpoint, setDefaultEndpoint, setInterceptors, setOrderpublic void setExpression(String expression)
public void setNamespaces(Map<String,String> namespaces)
public void afterPropertiesSet()
throws Exception
afterPropertiesSet in interface org.springframework.beans.factory.InitializingBeanExceptionprotected String getLookupKeyForMessage(MessageContext messageContext) throws Exception
AbstractMapBasedEndpointMappingnull if a key cannot be found.getLookupKeyForMessage in class AbstractMapBasedEndpointMappingnullExceptionprotected boolean validateLookupKey(String key)
AbstractMapBasedEndpointMappingtrue is the given string is valid.validateLookupKey in class AbstractMapBasedEndpointMappingCopyright © 2023 VMware, Inc.. All rights reserved.