Class Precondition.BooleanPrecondition

java.lang.Object
com.saxonica.ee.trans.Precondition
com.saxonica.ee.trans.Precondition.BooleanPrecondition
Enclosing class:
Precondition

public static class Precondition.BooleanPrecondition extends Precondition
A BooleanPrecondition can in principle test any boolean characteristic of a pattern. In practice it is used to test for the existence of a named ancestor/parent element. That is, in current use the Characteristic will always be an AncestorCharacteristic
  • Constructor Details

    • BooleanPrecondition

      public BooleanPrecondition(Characteristic characteristic)
      Create a precondition that maps directly to a boolean characteristic
      Parameters:
      characteristic - the boolean characteristic
  • Method Details

    • testPrecondition

      protected boolean testPrecondition(PreconditionMatcher matcher) throws XPathException
      Evaluate the precondition, which will be true if and only if the value of the characteristic for the current item is the boolean value true.
      Specified by:
      testPrecondition in class Precondition
      Parameters:
      matcher - the PreconditionMatcher: holds the dynamic context for evaluation.
      Returns:
      true if the precondition is satisfied
      Throws:
      XPathException - if evaluation of the precondition fails with a dynamic error
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object