Class XPathFactoryConfigurer.Builder

java.lang.Object
org.xmlunit.util.XPathFactoryConfigurer.Builder
Enclosing class:
XPathFactoryConfigurer

public static class XPathFactoryConfigurer.Builder extends Object
Builder for a XPathFactoryConfigurer.
Since:
XMLUnit 2.10.0
  • Constructor Details

    • Builder

      public Builder()
  • Method Details

    • build

      public XPathFactoryConfigurer build()
      Builds a XPathFactoryConfigurer.
      Returns:
      the configurer
    • withProperty

      public XPathFactoryConfigurer.Builder withProperty(String key, String value)
      Configures the factory with the given property, causes an exception in XPathFactoryConfigurer.configure(javax.xml.xpath.XPathFactory) if the property is not supported.

      This method will not do anything if XPathFactory doesn't support the setPropery method which has been added with Java 18.

      Parameters:
      key - key of the property to be set
      value - value for the property to set
      Returns:
      this
    • withSafeProperty

      public XPathFactoryConfigurer.Builder withSafeProperty(String key, String value)
      Configures the factory with the given property if it is supported.

      This method will not do anything if XPathFactory doesn't support the setPropery method which has been added with Java 18.

      Parameters:
      key - key of the property to be set
      value - value for the property to set
      Returns:
      this
    • withFeature

      public XPathFactoryConfigurer.Builder withFeature(String key, boolean value)
      Configures the factory with the given feature, causes an exception in XPathFactoryConfigurer.configure(javax.xml.xpath.XPathFactory) if the feature is not supported.
      Parameters:
      key - key of the feature to be set
      value - value for the feature to set
      Returns:
      this
    • withSafeFeature

      public XPathFactoryConfigurer.Builder withSafeFeature(String key, boolean value)
      Configures the factory with the given feature if it is supported.
      Parameters:
      key - key of the feature to be set
      value - value for the feature to set
      Returns:
      this
    • withExtensionFunctionsDisabled

      public XPathFactoryConfigurer.Builder withExtensionFunctionsDisabled()
      Configures the factory to not enable extension functions.
      Returns:
      this
    • withSecureProcessingEnabled

      public XPathFactoryConfigurer.Builder withSecureProcessingEnabled()
      Configures the factory to enable secure processing which disables all external access as well as execution of extension functions.
      Returns:
      this