Class XPathFactoryConfigurer


  • public class XPathFactoryConfigurer
    extends java.lang.Object
    Configures XpathFactories.
    Since:
    XMLUnit 2.10.0
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static class  XPathFactoryConfigurer.Builder
      Builder for a XPathFactoryConfigurer.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static XPathFactoryConfigurer Default
      The default instance which disables extension functions.
      private java.util.Map<java.lang.String,​java.lang.Boolean> features  
      private java.util.Map<java.lang.String,​java.lang.String> propertys  
      private java.util.Map<java.lang.String,​java.lang.Boolean> safeFeatures  
      private java.util.Map<java.lang.String,​java.lang.String> safePropertys  
      static XPathFactoryConfigurer SecureProcessing
      The instance which enables secure processing thus disables execution of extension functions.
      private static java.lang.reflect.Method setPropertyMethod  
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private XPathFactoryConfigurer​(java.util.Map<java.lang.String,​java.lang.String> propertys, java.util.Map<java.lang.String,​java.lang.String> safePropertys, java.util.Map<java.lang.String,​java.lang.Boolean> features, java.util.Map<java.lang.String,​java.lang.Boolean> safeFeatures)  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static XPathFactoryConfigurer.Builder builder()
      Creates a builder for XPathFactoryConfigurers.
      javax.xml.xpath.XPathFactory configure​(javax.xml.xpath.XPathFactory factory)
      Applies the current configuration.
      private static void setProperty​(javax.xml.xpath.XPathFactory fac, java.lang.String name, java.lang.String value)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • propertys

        private final java.util.Map<java.lang.String,​java.lang.String> propertys
      • safePropertys

        private final java.util.Map<java.lang.String,​java.lang.String> safePropertys
      • features

        private final java.util.Map<java.lang.String,​java.lang.Boolean> features
      • safeFeatures

        private final java.util.Map<java.lang.String,​java.lang.Boolean> safeFeatures
      • Default

        public static final XPathFactoryConfigurer Default
        The default instance which disables extension functions.

        In order to disable extension functions XPathFactory#setProperty needs to exists which requires Java18 or newer. SecureProcessing should be available on any JDK.

      • SecureProcessing

        public static final XPathFactoryConfigurer SecureProcessing
        The instance which enables secure processing thus disables execution of extension functions.
      • setPropertyMethod

        private static final java.lang.reflect.Method setPropertyMethod
    • Constructor Detail

      • XPathFactoryConfigurer

        private XPathFactoryConfigurer​(java.util.Map<java.lang.String,​java.lang.String> propertys,
                                       java.util.Map<java.lang.String,​java.lang.String> safePropertys,
                                       java.util.Map<java.lang.String,​java.lang.Boolean> features,
                                       java.util.Map<java.lang.String,​java.lang.Boolean> safeFeatures)
    • Method Detail

      • configure

        public javax.xml.xpath.XPathFactory configure​(javax.xml.xpath.XPathFactory factory)
        Applies the current configuration.
        Parameters:
        factory - the factory to configure
        Returns:
        the configured factory
        Throws:
        ConfigurationException - if any of the propertys or features set is not supported.
      • setProperty

        private static void setProperty​(javax.xml.xpath.XPathFactory fac,
                                        java.lang.String name,
                                        java.lang.String value)
                                 throws java.lang.Exception
        Throws:
        java.lang.Exception