Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,15 @@
*/
public abstract class AbstractXPathMessageSelector implements MessageSelector {

private final XPathExpression xPathExpresion;
private final XPathExpression xPathExpression;

private volatile XmlPayloadConverter converter = new DefaultXmlPayloadConverter();

/**
* @param xPathExpression XPath expression as a String
*/
public AbstractXPathMessageSelector(String xPathExpression) {
this.xPathExpresion = XPathExpressionFactory.createXPathExpression(xPathExpression);
this.xPathExpression = XPathExpressionFactory.createXPathExpression(xPathExpression);
}

/**
Expand All @@ -52,22 +52,22 @@ public AbstractXPathMessageSelector(String xPathExpression) {
public AbstractXPathMessageSelector(String xPathExpression, String prefix, String namespace) {
Map<String, String> namespaces = new HashMap<>();
namespaces.put(prefix, namespace);
this.xPathExpresion = XPathExpressionFactory.createXPathExpression(xPathExpression, namespaces);
this.xPathExpression = XPathExpressionFactory.createXPathExpression(xPathExpression, namespaces);
}

/**
* @param xPathExpression XPath expression as a String
* @param namespaces Map of namespaces with prefixes as the Map keys
*/
public AbstractXPathMessageSelector(String xPathExpression, Map<String, String> namespaces) {
this.xPathExpresion = XPathExpressionFactory.createXPathExpression(xPathExpression, namespaces);
this.xPathExpression = XPathExpressionFactory.createXPathExpression(xPathExpression, namespaces);
}

/**
* @param xPathExpression XPath expression
*/
public AbstractXPathMessageSelector(XPathExpression xPathExpression) {
this.xPathExpresion = xPathExpression;
this.xPathExpression = xPathExpression;
}

/**
Expand All @@ -83,8 +83,8 @@ protected XmlPayloadConverter getConverter() {
return this.converter;
}

protected XPathExpression getXPathExpresion() {
return this.xPathExpresion;
protected XPathExpression getXPathExpression() {
return this.xPathExpression;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ public BooleanTestXPathMessageSelector(XPathExpression expression) {
@Override
public boolean accept(Message<?> message) {
Node node = getConverter().convertToNode(message.getPayload());
return getXPathExpresion().evaluateAsBoolean(node);
return getXPathExpression().evaluateAsBoolean(node);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ public RegexTestXPathMessageSelector(XPathExpression expression, String regex) {
@Override
public boolean accept(Message<?> message) {
Node nodeToTest = getConverter().convertToNode(message.getPayload());
String xPathResult = getXPathExpresion().evaluateAsString(nodeToTest);
String xPathResult = getXPathExpression().evaluateAsString(nodeToTest);
return StringUtils.hasText(xPathResult) && xPathResult.matches(this.regex);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ public void setCaseSensitive(boolean caseSensitive) {
@Override
public boolean accept(Message<?> message) {
Node nodeToTest = getConverter().convertToNode(message.getPayload());
String xPathResult = getXPathExpresion().evaluateAsString(nodeToTest);
String xPathResult = getXPathExpression().evaluateAsString(nodeToTest);
if (this.caseSensitive) {
return this.valueToTestFor.equals(xPathResult);
}
Expand Down