public class XmlParserFactoryProducer extends Object
Constructor and Description |
---|
XmlParserFactoryProducer() |
Modifier and Type | Method and Description |
---|---|
static DocumentBuilderFactory |
createSecureDocBuilderFactory()
Creates an instance of
DocumentBuilderFactory class
with enabled XMLConstants.FEATURE_SECURE_PROCESSING property. |
static SAXParserFactory |
createSecureSAXParserFactory()
Creates an instance of
SAXParserFactory class with enabled XMLConstants.FEATURE_SECURE_PROCESSING property. |
static org.dom4j.io.SAXReader |
getSAXReader(EntityResolver resolver) |
public static DocumentBuilderFactory createSecureDocBuilderFactory() throws ParserConfigurationException
DocumentBuilderFactory
class
with enabled XMLConstants.FEATURE_SECURE_PROCESSING
property.
Enabling this feature prevents from some XXE attacks (e.g. XML bomb)
See PPP-3506 for more details.ParserConfigurationException
- if feature can't be enabledpublic static SAXParserFactory createSecureSAXParserFactory() throws SAXNotSupportedException, SAXNotRecognizedException, ParserConfigurationException
SAXParserFactory
class with enabled XMLConstants.FEATURE_SECURE_PROCESSING
property.
Enabling this feature prevents from some XXE attacks (e.g. XML bomb)ParserConfigurationException
- if a parser cannot
be created which satisfies the requested configuration.SAXNotRecognizedException
- When the underlying XMLReader does
not recognize the property name.SAXNotSupportedException
- When the underlying XMLReader
recognizes the property name but doesn't support the
property.public static org.dom4j.io.SAXReader getSAXReader(EntityResolver resolver)
Copyright © 2019 Hitachi Vantara. All rights reserved.