Package com.day.cq.dam.commons.xml
Class DocumentBuilderFactoryProvider
- java.lang.Object
-
- com.day.cq.dam.commons.xml.DocumentBuilderFactoryProvider
-
- All Implemented Interfaces:
SecureDocumentBuilderFactory
public class DocumentBuilderFactoryProvider extends java.lang.Object implements SecureDocumentBuilderFactory
-
-
Constructor Summary
Constructors Constructor Description DocumentBuilderFactoryProvider()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description javax.xml.parsers.DocumentBuilderFactory
createSecureBuilderFactory(java.lang.Boolean setNameSpaceAware)
Invoked when a new instance of DocumentBuilderFactory is required.javax.xml.parsers.DocumentBuilderFactory
createSecureBuilderFactory(java.lang.Boolean setNameSpaceAware, java.lang.Boolean setValidating)
-
-
-
Method Detail
-
createSecureBuilderFactory
public javax.xml.parsers.DocumentBuilderFactory createSecureBuilderFactory(java.lang.Boolean setNameSpaceAware) throws javax.xml.parsers.ParserConfigurationException
Description copied from interface:SecureDocumentBuilderFactory
Invoked when a new instance of DocumentBuilderFactory is required.- Specified by:
createSecureBuilderFactory
in interfaceSecureDocumentBuilderFactory
- Parameters:
setNameSpaceAware
- Whether to set NamespaceAware configuration for DocumentBuilderFactory to true or not.- Returns:
- A new instance of DocumentBuilderFactory.
- Throws:
javax.xml.parsers.ParserConfigurationException
- If a DocumentBuilder cannot be created which satisfies the configuration requested. Following configurations has been added factory.setNamespaceAware(true); factory.setValidating(true); factory.setExpandEntityReferences(false); factory.setFeature("http://xml.org/sax/features/validation", true); // do not include external general entities factory.setFeature("http://xml.org/sax/features/external-general-entities", false); // do not include external parameter entities or the external DTD subset factory.setFeature("http://xml.org/sax/features/external-parameter-entities", false); // build the grammar but do not use the default attributes and attribute types information it contains factory.setFeature("http://apache.org/xml/features/nonvalidating/load-dtd-grammar", false); // ignore the external DTD completely factory.setFeature("http://apache.org/xml/features/nonvalidating/load-external-dtd", false);
-
createSecureBuilderFactory
public javax.xml.parsers.DocumentBuilderFactory createSecureBuilderFactory(java.lang.Boolean setNameSpaceAware, java.lang.Boolean setValidating) throws javax.xml.parsers.ParserConfigurationException
- Throws:
javax.xml.parsers.ParserConfigurationException
-
-