public class PSXPathQueryBinding extends Object implements IPSQueryBinding
Modifier and Type | Field and Description |
---|---|
static char |
PARAM_VARIABLE_PREFIX |
Modifier and Type | Method and Description |
---|---|
IPSBoundSchema |
bind(PSSchema aSchema,
String sPhase,
IPSErrorHandler aCustomErrorListener) |
IPSBoundSchema |
bind(PSSchema aSchema,
String sPhase,
IPSErrorHandler aCustomErrorListener,
XPathVariableResolver aVariableResolver,
XPathFunctionResolver aFunctionResolver)
Create a bound schema, which is like a precompiled schema.
|
static PSXPathQueryBinding |
getInstance() |
String |
getNegatedTestExpression(String sTest)
Negate the passed test statement.
|
com.helger.commons.collection.ext.ICommonsNavigableMap<String,String> |
getStringReplacementMap(List<PSParam> aParams)
Convert the passed list of
PSParam elements to a map suitable for
String replacement. |
String |
getWithParamTextsReplaced(String sText,
Map<String,String> aStringReplacements)
Apply the Map created by
IPSQueryBinding.getNegatedTestExpression(String) on a
single string. |
static String |
getWithParamTextsReplacedStatic(String sText,
Map<String,String> aStringReplacements) |
public static final char PARAM_VARIABLE_PREFIX
@Nonnull public static PSXPathQueryBinding getInstance()
@Nonnull public String getNegatedTestExpression(@Nonnull String sTest)
IPSQueryBinding
getNegatedTestExpression
in interface IPSQueryBinding
sTest
- The test expression.@Nonnull @ReturnsMutableCopy public com.helger.commons.collection.ext.ICommonsNavigableMap<String,String> getStringReplacementMap(@Nonnull List<PSParam> aParams)
IPSQueryBinding
PSParam
elements to a map suitable for
String replacement. This is needed to resolve placeholders in abstract
patterns. The default query binding e.g. adds a "$" in front of each
parameter name. The so created map is used to resolve abstract rule and
pattern data to real values.getStringReplacementMap
in interface IPSQueryBinding
aParams
- Source list. May not be null
.null
String replacement map.@Nullable public static String getWithParamTextsReplacedStatic(@Nullable String sText, @Nullable Map<String,String> aStringReplacements)
@Nullable public String getWithParamTextsReplaced(@Nullable String sText, @Nullable Map<String,String> aStringReplacements)
IPSQueryBinding
IPSQueryBinding.getNegatedTestExpression(String)
on a
single string.PSAssertReport
PSRule
PSValueOf
getWithParamTextsReplaced
in interface IPSQueryBinding
sText
- The original text. May be null
.aStringReplacements
- All replacements as map from source to target. The map should be
ordered by longest keys first.null
if the input string was null
.@Nonnull public IPSBoundSchema bind(@Nonnull PSSchema aSchema, @Nullable String sPhase, @Nullable IPSErrorHandler aCustomErrorListener) throws SchematronException
SchematronException
@Nonnull public IPSBoundSchema bind(@Nonnull PSSchema aSchema, @Nullable String sPhase, @Nullable IPSErrorHandler aCustomErrorListener, @Nullable XPathVariableResolver aVariableResolver, @Nullable XPathFunctionResolver aFunctionResolver) throws SchematronException
IPSQueryBinding
bind
in interface IPSQueryBinding
aSchema
- The schema to be bound. May not be null
.sPhase
- The phase to use. May be null
. If it is
null
than the defaultPhase is used that is defined in
the schema. If no defaultPhase is present, than all patterns are
evaluated.aCustomErrorListener
- An optional custom error handler to use. May be null
.aVariableResolver
- Custom variable resolver. May be null
.aFunctionResolver
- Custom function resolver. May be null
.null
.SchematronException
- In case of a binding errorCopyright © 2014–2016 Philip Helger. All rights reserved.