Package org.xmlunit.util
Class XPathFactoryConfigurer
- java.lang.Object
-
- org.xmlunit.util.XPathFactoryConfigurer
-
public class XPathFactoryConfigurer extends java.lang.ObjectConfigures XpathFactories.- Since:
- XMLUnit 2.10.0
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classXPathFactoryConfigurer.BuilderBuilder for a XPathFactoryConfigurer.
-
Field Summary
Fields Modifier and Type Field Description static XPathFactoryConfigurerDefaultThe default instance which disables extension functions.private java.util.Map<java.lang.String,java.lang.Boolean>featuresprivate java.util.Map<java.lang.String,java.lang.String>propertysprivate java.util.Map<java.lang.String,java.lang.Boolean>safeFeaturesprivate java.util.Map<java.lang.String,java.lang.String>safePropertysstatic XPathFactoryConfigurerSecureProcessingThe instance which enables secure processing thus disables execution of extension functions.private static java.lang.reflect.MethodsetPropertyMethod
-
Constructor Summary
Constructors Modifier Constructor Description privateXPathFactoryConfigurer(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.Builderbuilder()Creates a builder for XPathFactoryConfigurers.javax.xml.xpath.XPathFactoryconfigure(javax.xml.xpath.XPathFactory factory)Applies the current configuration.private static voidsetProperty(javax.xml.xpath.XPathFactory fac, java.lang.String name, java.lang.String value)
-
-
-
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.
SecureProcessingshould 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.
-
builder
public static XPathFactoryConfigurer.Builder builder()
Creates a builder for XPathFactoryConfigurers.- Returns:
- a fresh builder
-
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
-
-