Package org.xmlunit.placeholder
Class PlaceholderSupport
java.lang.Object
org.xmlunit.placeholder.PlaceholderSupport
Adds support for the placeholder feature to a
DifferenceEngineConfigurer
- like DiffBuilder
or
org.xmlunit.matchers.CompareMatcher
.
This class and the whole module are considered experimental and any API may change between releases of XMLUnit.
- Since:
- 2.6.0
-
Method Summary
Modifier and TypeMethodDescriptionstatic <D extends DifferenceEngineConfigurer<D>>
DwithPlaceholderSupport
(D configurer) Adds placeholder support to aDifferenceEngineConfigurer
.static <D extends DifferenceEngineConfigurer<D>>
DwithPlaceholderSupportChainedAfter
(D configurer, DifferenceEvaluator evaluator) Adds placeholder support to aDifferenceEngineConfigurer
considering an additionalDifferenceEvaluator
.static <D extends DifferenceEngineConfigurer<D>>
DwithPlaceholderSupportUsingDelimiters
(D configurer, String placeholderOpeningDelimiterRegex, String placeholderClosingDelimiterRegex) Adds placeholder support to aDifferenceEngineConfigurer
.static <D extends DifferenceEngineConfigurer<D>>
DwithPlaceholderSupportUsingDelimiters
(D configurer, String placeholderOpeningDelimiterRegex, String placeholderClosingDelimiterRegex, String placeholderArgsOpeningDelimiterRegex, String placeholderArgsClosingDelimiterRegex, String placeholderArgsSeparatorRegex) Adds placeholder support to aDifferenceEngineConfigurer
.static <D extends DifferenceEngineConfigurer<D>>
DwithPlaceholderSupportUsingDelimitersChainedAfter
(D configurer, String placeholderOpeningDelimiterRegex, String placeholderClosingDelimiterRegex, String placeholderArgsOpeningDelimiterRegex, String placeholderArgsClosingDelimiterRegex, String placeholderArgsSeparatorRegex, DifferenceEvaluator evaluator) Adds placeholder support to aDifferenceEngineConfigurer
considering an additionalDifferenceEvaluator
.static <D extends DifferenceEngineConfigurer<D>>
DwithPlaceholderSupportUsingDelimitersChainedAfter
(D configurer, String placeholderOpeningDelimiterRegex, String placeholderClosingDelimiterRegex, DifferenceEvaluator evaluator) Adds placeholder support to aDifferenceEngineConfigurer
considering an additionalDifferenceEvaluator
.
-
Method Details
-
withPlaceholderSupport
Adds placeholder support to aDifferenceEngineConfigurer
.This overwrites any
DifferenceEvaluator
set via earlier invocations ofwithDifferenceEvaluator
.- Type Parameters:
D
- type of configurer- Parameters:
configurer
- the configurer to add support to- Returns:
- the configurer with placeholder support added in
-
withPlaceholderSupportUsingDelimiters
public static <D extends DifferenceEngineConfigurer<D>> D withPlaceholderSupportUsingDelimiters(D configurer, String placeholderOpeningDelimiterRegex, String placeholderClosingDelimiterRegex) Adds placeholder support to aDifferenceEngineConfigurer
.This overwrites any
DifferenceEvaluator
set via earlier invocations ofwithDifferenceEvaluator
.- Type Parameters:
D
- type of configurer- Parameters:
configurer
- the configurer to add support toplaceholderOpeningDelimiterRegex
- regular expression for the opening delimiter of placeholder, defaults toPlaceholderDifferenceEvaluator.PLACEHOLDER_DEFAULT_OPENING_DELIMITER_REGEX
if the parameter is null or blankplaceholderClosingDelimiterRegex
- regular expression for the closing delimiter of placeholder, defaults toPlaceholderDifferenceEvaluator.PLACEHOLDER_DEFAULT_CLOSING_DELIMITER_REGEX
if the parameter is null or blank- Returns:
- the configurer with placeholder support added in
-
withPlaceholderSupportUsingDelimiters
public static <D extends DifferenceEngineConfigurer<D>> D withPlaceholderSupportUsingDelimiters(D configurer, String placeholderOpeningDelimiterRegex, String placeholderClosingDelimiterRegex, String placeholderArgsOpeningDelimiterRegex, String placeholderArgsClosingDelimiterRegex, String placeholderArgsSeparatorRegex) Adds placeholder support to aDifferenceEngineConfigurer
.This overwrites any
DifferenceEvaluator
set via earlier invocations ofwithDifferenceEvaluator
.- Type Parameters:
D
- type of configurer- Parameters:
configurer
- the configurer to add support toplaceholderOpeningDelimiterRegex
- regular expression for the opening delimiter of placeholder, defaults toPlaceholderDifferenceEvaluator.PLACEHOLDER_DEFAULT_OPENING_DELIMITER_REGEX
if the parameter is null or blankplaceholderClosingDelimiterRegex
- regular expression for the closing delimiter of placeholder, defaults toPlaceholderDifferenceEvaluator.PLACEHOLDER_DEFAULT_CLOSING_DELIMITER_REGEX
if the parameter is null or blankplaceholderArgsOpeningDelimiterRegex
- regular expression for the opening delimiter of the placeholder's argument list, defaults toPlaceholderDifferenceEvaluator.PLACEHOLDER_DEFAULT_ARGS_OPENING_DELIMITER_REGEX
if the parameter is null or blankplaceholderArgsClosingDelimiterRegex
- regular expression for the closing delimiter of the placeholder's argument list, defaults toPlaceholderDifferenceEvaluator.PLACEHOLDER_DEFAULT_ARGS_CLOSING_DELIMITER_REGEX
if the parameter is null or blankplaceholderArgsSeparatorRegex
- regular expression for the delimiter between arguments inside of the placeholder's argument list, defaults toPlaceholderDifferenceEvaluator.PLACEHOLDER_DEFAULT_ARGS_SEPARATOR_REGEX
if the parameter is null or blank- Returns:
- the configurer with placeholder support added in
- Since:
- 2.7.0
-
withPlaceholderSupportChainedAfter
public static <D extends DifferenceEngineConfigurer<D>> D withPlaceholderSupportChainedAfter(D configurer, DifferenceEvaluator evaluator) Adds placeholder support to aDifferenceEngineConfigurer
considering an additionalDifferenceEvaluator
.This overwrites any
DifferenceEvaluator
set via earlier invocations ofwithDifferenceEvaluator
.- Type Parameters:
D
- type of configurer- Parameters:
configurer
- the configurer to add support toevaluator
- the additional evaluator - placeholder support ischain
ed after the given evaluator- Returns:
- the configurer with placeholder support added in
-
withPlaceholderSupportUsingDelimitersChainedAfter
public static <D extends DifferenceEngineConfigurer<D>> D withPlaceholderSupportUsingDelimitersChainedAfter(D configurer, String placeholderOpeningDelimiterRegex, String placeholderClosingDelimiterRegex, DifferenceEvaluator evaluator) Adds placeholder support to aDifferenceEngineConfigurer
considering an additionalDifferenceEvaluator
.This overwrites any
DifferenceEvaluator
set via earlier invocations ofwithDifferenceEvaluator
.- Type Parameters:
D
- type of configurer- Parameters:
configurer
- the configurer to add support toplaceholderOpeningDelimiterRegex
- regular expression for the opening delimiter of placeholder, defaults toPlaceholderDifferenceEvaluator.PLACEHOLDER_DEFAULT_OPENING_DELIMITER_REGEX
if the parameter is null or blankplaceholderClosingDelimiterRegex
- regular expression for the closing delimiter of placeholder, defaults toPlaceholderDifferenceEvaluator.PLACEHOLDER_DEFAULT_CLOSING_DELIMITER_REGEX
if the parameter is null or blankevaluator
- the additional evaluator - placeholder support ischain
ed after the given evaluator- Returns:
- the configurer with placeholder support added in
-
withPlaceholderSupportUsingDelimitersChainedAfter
public static <D extends DifferenceEngineConfigurer<D>> D withPlaceholderSupportUsingDelimitersChainedAfter(D configurer, String placeholderOpeningDelimiterRegex, String placeholderClosingDelimiterRegex, String placeholderArgsOpeningDelimiterRegex, String placeholderArgsClosingDelimiterRegex, String placeholderArgsSeparatorRegex, DifferenceEvaluator evaluator) Adds placeholder support to aDifferenceEngineConfigurer
considering an additionalDifferenceEvaluator
.This overwrites any
DifferenceEvaluator
set via earlier invocations ofwithDifferenceEvaluator
.- Type Parameters:
D
- type of configurer- Parameters:
configurer
- the configurer to add support toplaceholderOpeningDelimiterRegex
- regular expression for the opening delimiter of placeholder, defaults toPlaceholderDifferenceEvaluator.PLACEHOLDER_DEFAULT_OPENING_DELIMITER_REGEX
if the parameter is null or blankplaceholderClosingDelimiterRegex
- regular expression for the closing delimiter of placeholder, defaults toPlaceholderDifferenceEvaluator.PLACEHOLDER_DEFAULT_CLOSING_DELIMITER_REGEX
if the parameter is null or blankevaluator
- the additional evaluator - placeholder support ischain
ed after the given evaluatorplaceholderArgsOpeningDelimiterRegex
- regular expression for the opening delimiter of the placeholder's argument list, defaults toPlaceholderDifferenceEvaluator.PLACEHOLDER_DEFAULT_ARGS_OPENING_DELIMITER_REGEX
if the parameter is null or blankplaceholderArgsClosingDelimiterRegex
- regular expression for the closing delimiter of the placeholder's argument list, defaults toPlaceholderDifferenceEvaluator.PLACEHOLDER_DEFAULT_ARGS_CLOSING_DELIMITER_REGEX
if the parameter is null or blankplaceholderArgsSeparatorRegex
- regular expression for the delimiter between arguments inside of the placeholder's argument list, defaults toPlaceholderDifferenceEvaluator.PLACEHOLDER_DEFAULT_ARGS_SEPARATOR_REGEX
if the parameter is null or blank- Returns:
- the configurer with placeholder support added in
-