Class XmlFactories


  • @Deprecated(since="3.12.0",
                forRemoval=true)
    public class XmlFactories
    extends Object
    Deprecated, for removal: This API element is subject to removal in a future version.
    use XmlFactories
    Provides XML factories that are pre-configured for secure XML processing. The factories are configured to mitigate the risk of XML External Entity (XXE) attacks, notably to reject external DTD or Schema resolution.
    Since:
    3.0.0
    • Method Detail

      • newDocumentBuilderFactory

        public static DocumentBuilderFactory newDocumentBuilderFactory()
        Deprecated, for removal: This API element is subject to removal in a future version.
        Returns a document builder factory configured to mitigate the risk of XML External Entity (XXE) attacks.

        Clients are recommended to directly use newDocumentBuilder() when no additional configuration is to perform on the factory.

        Returns:
        a new document builder factory
        See Also:
        newDocumentBuilder()
      • newDocumentBuilder

        public static DocumentBuilder newDocumentBuilder()
                                                  throws ParserConfigurationException
        Deprecated, for removal: This API element is subject to removal in a future version.
        Returns a document builder configured to mitigate the risk of XML External Entity (XXE) attacks.
        Returns:
        a new document builder
        Throws:
        ParserConfigurationException - if a DocumentBuilder cannot be created which satisfies the configuration requested.
      • newDocumentBuilder

        public static DocumentBuilder newDocumentBuilder​(DocumentBuilderFactory factory)
                                                  throws ParserConfigurationException
        Deprecated, for removal: This API element is subject to removal in a future version.
        Returns a document builder configured to mitigate the risk of XML External Entity (XXE) attacks, based on the given builder factory.

        Clients are recommended to directly use newDocumentBuilder() when no additional configuration is to perform on the factory.

        Parameters:
        factory - the factory to create a document builder.
        Returns:
        a new document builder
        Throws:
        ParserConfigurationException - if a DocumentBuildercannot be created which satisfies the configuration requested.
        See Also:
        newDocumentBuilder()
      • newSAXParserFactory

        public static SAXParserFactory newSAXParserFactory()
        Deprecated, for removal: This API element is subject to removal in a future version.
        Returns a SAXParseFactory configured to mitigate the risk of XML External Entity (XXE) attacks.
        Returns:
        a new SAXParseFactory.
      • newTransformerFactory

        public static TransformerFactory newTransformerFactory()
        Deprecated, for removal: This API element is subject to removal in a future version.
        Returns a transformer factory configured to mitigate the risk of XML External Entity (XXE) attacks.
        Returns:
        a new transformer factory.