| Modifier and Type | Field and Description |
|---|---|
| private final XPathExpression | |
| private final QName | |
| public static final NamespaceContext | |
| private static final Condition. | |
| private final Matcher | |
| private static final IsAnything | |
| private final String |
| Access | Constructor and Description |
|---|---|
| public | |
| public | HasXPath(String
XPath expression. xPathExpression, NamespaceContext Resolves XML namespace prefixes in the XPath expression namespaceContext, Matcher<String> Matcher to use at given XPath.
May be null to specify that the XPath must exist but the value is irrelevant. valueMatcher)
|
| private |
| Modifier and Type | Method and Description |
|---|---|
| private static XPathExpression | |
| public void | describeTo(Description
The description to be built or appended to. description)Implements org. |
| private Condition | |
| public static Matcher | hasXPath(String
the target xpath xPath, Matcher<String> matcher for the value at the specified xpath valueMatcher)Creates a matcher of |
| public static Matcher | hasXPath(String
the target xpath xPath, NamespaceContext the namespace for matching nodes namespaceContext, Matcher<String> matcher for the value at the specified xpath valueMatcher)Creates a matcher of |
| public static Matcher | hasXPath(String
the target xpath xPath)Creates a matcher of |
| public static Matcher | hasXPath(String
the target xpath xPath, NamespaceContext the namespace for matching nodes namespaceContext)Creates a matcher of |
| public boolean | matchesSafely(Node item, Description mismatch)
Implements abstract org. |
| private static Condition. |
| compiledXPath | back to summary |
|---|---|
| private final XPathExpression compiledXPath | |
| evaluationMode | back to summary |
|---|---|
| private final QName evaluationMode | |
| NO_NAMESPACE_CONTEXT | back to summary |
|---|---|
| public static final NamespaceContext NO_NAMESPACE_CONTEXT | |
| NODE_EXISTS | back to summary |
|---|---|
| private static final Condition. | |
| valueMatcher | back to summary |
|---|---|
| private final Matcher<String> valueMatcher | |
| WITH_ANY_CONTENT | back to summary |
|---|---|
| private static final IsAnything<String> WITH_ANY_CONTENT | |
| xpathString | back to summary |
|---|---|
| private final String xpathString | |
| HasXPath | back to summary |
|---|---|
| public HasXPath(String xPathExpression, Matcher<String> valueMatcher) | |
| HasXPath | back to summary |
|---|---|
public HasXPath(String xPathExpression, NamespaceContext namespaceContext, Matcher<String> valueMatcher)
| |
| HasXPath | back to summary |
|---|---|
| private HasXPath(String xPathExpression, NamespaceContext namespaceContext, Matcher<String> valueMatcher, QName mode) | |
| compiledXPath | back to summary |
|---|---|
| private static XPathExpression compiledXPath(String xPathExpression, NamespaceContext namespaceContext) | |
| describeTo | back to summary |
|---|---|
| public void describeTo(Description description) Implements org. Doc from org. Generates a description of the object. The description may be part of a a description of a larger object of which this is just a component, so it should be worded appropriately.
| |
| evaluated | back to summary |
|---|---|
| private Condition | |
| hasXPath | back to summary |
|---|---|
| public static Matcher Creates a matcher of For example: assertThat(xml, hasXPath("/root/something[2]/cheese", equalTo("Cheddar")))
| |
| hasXPath | back to summary |
|---|---|
| public static Matcher Creates a matcher of For example: assertThat(xml, hasXPath("/root/something[2]/cheese", myNs, equalTo("Cheddar")))
| |
| hasXPath | back to summary |
|---|---|
| public static Matcher Creates a matcher of For example: assertThat(xml, hasXPath("/root/something[2]/cheese"))
| |
| hasXPath | back to summary |
|---|---|
| public static Matcher Creates a matcher of For example: assertThat(xml, hasXPath("/root/something[2]/cheese", myNs))
| |
| matchesSafely | back to summary |
|---|---|
| public boolean matchesSafely(Node item, Description mismatch) Implements abstract org. Doc from org. Subclasses should implement this. The item will already have been checked for the specific type and will never be null.
| |
| nodeExists | back to summary |
|---|---|
| private static Condition. | |