public class DefaultSafeXmlParserFactory extends Object implements IXmlParserFactory
IXmlParserFactory for creating safe xml parser objects. Creates parsers with configuration to prevent XML bombs and XXE attacks.
| Constructor and Description |
|---|
DefaultSafeXmlParserFactory()
Creates instance of DefaultSafeXmlParserFactory.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
configureSafeDocumentBuilderFactory(DocumentBuilderFactory factory)
Configures document builder factory to make it secure against xml attacks.
|
protected void |
configureSafeSAXParserFactory(SAXParserFactory factory)
Configures SAX parser factory to make it secure against xml attacks.
|
protected DocumentBuilderFactory |
createDocumentBuilderFactory()
Creates a document builder factory implementation.
|
DocumentBuilder |
createDocumentBuilderInstance(boolean namespaceAware, boolean ignoringComments)
Creates the instance of the DocumentBuilder.
|
protected SAXParserFactory |
createSAXParserFactory()
Creates a SAX parser factory implementation.
|
XMLReader |
createXMLReaderInstance(boolean namespaceAware, boolean validating)
Creates the instance of the XMLReader.
|
public DefaultSafeXmlParserFactory()
DefaultSafeXmlParserFactory.
public DocumentBuilder createDocumentBuilderInstance(boolean namespaceAware, boolean ignoringComments)
IXmlParserFactory
DocumentBuilder.
createDocumentBuilderInstance in interface IXmlParserFactory
namespaceAware - specifies whether the parser should be namespace aware
ignoringComments - specifies whether the parser should ignore comments
DocumentBuilder
public XMLReader createXMLReaderInstance(boolean namespaceAware, boolean validating)
IXmlParserFactory
XMLReader.
createXMLReaderInstance in interface IXmlParserFactory
namespaceAware - specifies whether the parser should be namespace aware
validating - specifies whether the parser should validate documents as they are parsed
XMLReader
protected DocumentBuilderFactory createDocumentBuilderFactory()
DocumentBuilderFactory.newInstance() call
protected SAXParserFactory createSAXParserFactory()
SAXParserFactory.newInstance() call
protected void configureSafeDocumentBuilderFactory(DocumentBuilderFactory factory)
factory - DocumentBuilderFactory instance to be configured
protected void configureSafeSAXParserFactory(SAXParserFactory factory)
factory - SAXParserFactory instance to be configured
Copyright © 1998–2022 iText Group NV. All rights reserved.