public class HasXPath extends TypeSafeDiagnosingMatcher<Node>
Constructor and Description |
---|
HasXPath(String xPathExpression,
Matcher<? super String> valueMatcher) |
HasXPath(String xPathExpression,
NamespaceContext namespaceContext,
Matcher<? super String> valueMatcher) |
Modifier and Type | Method and Description |
---|---|
void |
describeTo(Description description)
Generates a description of the object.
|
static Matcher<Node> |
hasXPath(String xPath) |
static Matcher<Node> |
hasXPath(String xPath,
Matcher<? super String> valueMatcher) |
static Matcher<Node> |
hasXPath(String xPath,
NamespaceContext namespaceContext) |
static Matcher<Node> |
hasXPath(String xPath,
NamespaceContext namespaceContext,
Matcher<? super String> valueMatcher) |
boolean |
matchesSafely(Node item,
Description mismatchDescription)
Subclasses should implement this.
|
describeMismatch, matches
_dont_implement_Matcher___instead_extend_BaseMatcher_, toString
public HasXPath(String xPathExpression, Matcher<? super String> valueMatcher)
xPathExpression
- XPath expression.valueMatcher
- Matcher to use at given XPath.
May be null to specify that the XPath must exist but the value is irrelevant.public HasXPath(String xPathExpression, NamespaceContext namespaceContext, Matcher<? super String> valueMatcher)
xPathExpression
- XPath expression.namespaceContext
- Resolves XML namespace prefixes in the XPath expressionvalueMatcher
- Matcher to use at given XPath.
May be null to specify that the XPath must exist but the value is irrelevant.public boolean matchesSafely(Node item, Description mismatchDescription)
TypeSafeDiagnosingMatcher
matchesSafely
in class TypeSafeDiagnosingMatcher<Node>
public void describeTo(Description description)
SelfDescribing
description
- The description to be built or appended to.public static Matcher<Node> hasXPath(String xPath, NamespaceContext namespaceContext, Matcher<? super String> valueMatcher)
public static Matcher<Node> hasXPath(String xPath, NamespaceContext namespaceContext)
Copyright © 2016. All rights reserved.