Package de.xima.fc.transform.xml
Class SecureXmlFactories
- java.lang.Object
-
- de.xima.fc.transform.xml.SecureXmlFactories
-
public class SecureXmlFactories extends Object
Factory for securely pre-configured factories for processing XML- Since:
- 6.6.8
- Author:
- XIMA Media GmbH
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static DocumentBuilderFactory
newDocumentBuilderFactory()
Creates a newDocumentBuilderFactory
and configures it for secure XML processing.static SAXParserFactory
newSAXParserFactory()
static TransformerFactory
newTransformerFactory()
Obtains a new instance of aTransformerFactory
and configures it for secure processing.static DocumentBuilderFactory
wrapDocumentBuilderFactory(DocumentBuilderFactory factory)
Wraps aDocumentBuilderFactory
and configures it for secure XML processing.static SchemaFactory
wrapSchemaFactory(SchemaFactory schemaFactory)
Wraps the givenSchemaFactory
for secure XML processing.static TransformerFactory
wrapTransformerFactory(TransformerFactory factory)
Wraps the givenTransformerFactory
for secure XML processing.static XMLInputFactory
wrapXmlInputFactory(XMLInputFactory factory)
Wraps the givenXMLInputFactory
for secure XML processing.static XMLOutputFactory
wrapXmlOutputFactory(XMLOutputFactory factory)
Wraps the givenXMLOutputFactory
for secure XML processing.
-
-
-
Method Detail
-
newDocumentBuilderFactory
public static DocumentBuilderFactory newDocumentBuilderFactory() throws ParserConfigurationException
Creates a newDocumentBuilderFactory
and configures it for secure XML processing. The newly creates factory isnamespace aware
.- Returns:
- A document builder factory that is secure.
- Throws:
ParserConfigurationException
- If a configuration error is encountered.
-
newSAXParserFactory
public static SAXParserFactory newSAXParserFactory() throws ParserConfigurationException, SAXException
-
newTransformerFactory
public static TransformerFactory newTransformerFactory() throws TransformerConfigurationException
Obtains a new instance of aTransformerFactory
and configures it for secure processing. This method uses the JAXP Lookup Mechanism to determine theTransformerFactory
implementation class to load.Once an application has obtained a reference to a
TransformerFactory
, it can use the factory to configure and obtain transformer instances.- Returns:
- new TransformerFactory instance, never null.
- Throws:
TransformerFactoryConfigurationError
- Thrown in case of service configuration error or if the implementation is not available or cannot be instantiated.TransformerConfigurationException
-
wrapDocumentBuilderFactory
public static DocumentBuilderFactory wrapDocumentBuilderFactory(DocumentBuilderFactory factory) throws ParserConfigurationException
Wraps aDocumentBuilderFactory
and configures it for secure XML processing.- Returns:
- The wrapped document builder factory that is secure.
- Throws:
ParserConfigurationException
- If a configuration error is encountered.
-
wrapSchemaFactory
public static SchemaFactory wrapSchemaFactory(SchemaFactory schemaFactory) throws SAXException
Wraps the givenSchemaFactory
for secure XML processing.- Throws:
IllegalArgumentException
- If no implementation of the schema language is available.NullPointerException
- If theschemaLanguage
parameter is null.SchemaFactoryConfigurationError
- If a configuration error is encountered.SAXException
- When the factory could not be configured with the secure settings.- Since:
- 8.4.0
-
wrapTransformerFactory
public static TransformerFactory wrapTransformerFactory(TransformerFactory factory) throws TransformerException
Wraps the givenTransformerFactory
for secure XML processing.- Returns:
- A transformer factory that is secure.
- Throws:
TransformerConfigurationException
- If a configuration error is encountered.TransformerException
- Since:
- 8.4.0
-
wrapXmlInputFactory
public static XMLInputFactory wrapXmlInputFactory(XMLInputFactory factory)
Wraps the givenXMLInputFactory
for secure XML processing.- Returns:
- An XML input factory that is secure.
- Throws:
FactoryConfigurationError
- If a configuration error is encountered.- Since:
- 8.4.0
-
wrapXmlOutputFactory
public static XMLOutputFactory wrapXmlOutputFactory(XMLOutputFactory factory)
Wraps the givenXMLOutputFactory
for secure XML processing.- Returns:
- An XML output factory that is secure.
- Throws:
FactoryConfigurationError
- If a configuration error is encountered.- Since:
- 8.4.0
-
-