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)
IXmlParserFactoryDocumentBuilder.createDocumentBuilderInstance in interface IXmlParserFactorynamespaceAware - specifies whether the parser should be namespace awareignoringComments - specifies whether the parser should ignore commentsDocumentBuilderpublic XMLReader createXMLReaderInstance(boolean namespaceAware, boolean validating)
IXmlParserFactoryXMLReader.createXMLReaderInstance in interface IXmlParserFactorynamespaceAware - specifies whether the parser should be namespace awarevalidating - specifies whether the parser should validate documents as they are parsedXMLReaderprotected DocumentBuilderFactory createDocumentBuilderFactory()
DocumentBuilderFactory.newInstance() callprotected SAXParserFactory createSAXParserFactory()
SAXParserFactory.newInstance() callprotected void configureSafeDocumentBuilderFactory(DocumentBuilderFactory factory)
factory - DocumentBuilderFactory instance to be configuredprotected void configureSafeSAXParserFactory(SAXParserFactory factory)
factory - SAXParserFactory instance to be configuredCopyright © 1998–2023 iText Group NV. All rights reserved.