Interface IPSQueryBinding

All Superinterfaces:
Serializable
All Known Implementing Classes:
PSXPathQueryBinding

public interface IPSQueryBinding extends Serializable
Base interface for a single query binding.
Author:
Philip Helger
  • Method Details

    • getNegatedTestExpression

      String getNegatedTestExpression(@Nonnull String sTest)
      Negate the passed test statement. This is required in the creation of a minified Schematron, when report elements are converted to assert elements.
      Parameters:
      sTest - The test expression.
      Returns:
      The negated test expression
    • getStringReplacementMap

      @Nonnull @ReturnsMutableCopy com.helger.commons.collection.impl.ICommonsNavigableMap<String,String> getStringReplacementMap(@Nonnull List<PSParam> aParams)
      Convert the passed list of 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.
      Parameters:
      aParams - Source list. May not be null.
      Returns:
      Non-null String replacement map.
    • getWithParamTextsReplaced

      @Nullable String getWithParamTextsReplaced(@Nullable String sText, @Nullable Map<String,String> aStringReplacements)
      Apply the Map created by getNegatedTestExpression(String) on a single string.
      According to iso_abstract_expand.xsl, line 233 the text replacements happen for the following attributes: As an experimental option in line 244 the replacement is also applied to all text nodes. This is currently not supported!
      Parameters:
      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.
      Returns:
      null if the input string was null.
    • bind

      @Nonnull default IPSBoundSchema bind(@Nonnull PSSchema aSchema) throws com.helger.schematron.SchematronException
      Throws:
      com.helger.schematron.SchematronException
    • bind

      @Nonnull IPSBoundSchema bind(@Nonnull PSSchema aSchema, @Nullable String sPhase, @Nullable IPSErrorHandler aCustomErrorHandler, @Nullable IPSValidationHandler aCustomValidationHandler, @Nullable IXPathConfig aXPathConfig) throws com.helger.schematron.SchematronException
      Create a bound schema, which is like a precompiled schema.
      Parameters:
      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.
      aCustomErrorHandler - An optional custom error handler to use. May be null.
      aCustomValidationHandler - A custom PS validation handler to use. May be null.
      aXPathConfig - The XPath configuration to be used. May be null.
      Returns:
      The bound schema and never null.
      Throws:
      com.helger.schematron.SchematronException - In case of a binding error
      Since:
      5.5.0