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 DocumentBuilderFactorynewDocumentBuilderFactory()Creates a newDocumentBuilderFactoryand configures it for secure XML processing.static SAXParserFactorynewSAXParserFactory()static TransformerFactorynewTransformerFactory()Obtains a new instance of aTransformerFactoryand configures it for secure processing.static DocumentBuilderFactorywrapDocumentBuilderFactory(DocumentBuilderFactory factory)Wraps aDocumentBuilderFactoryand configures it for secure XML processing.static SchemaFactorywrapSchemaFactory(SchemaFactory schemaFactory)Wraps the givenSchemaFactoryfor secure XML processing.static TransformerFactorywrapTransformerFactory(TransformerFactory factory)Wraps the givenTransformerFactoryfor secure XML processing.static XMLInputFactorywrapXmlInputFactory(XMLInputFactory factory)Wraps the givenXMLInputFactoryfor secure XML processing.static XMLOutputFactorywrapXmlOutputFactory(XMLOutputFactory factory)Wraps the givenXMLOutputFactoryfor secure XML processing.
-
-
-
Method Detail
-
newDocumentBuilderFactory
public static DocumentBuilderFactory newDocumentBuilderFactory() throws ParserConfigurationException
Creates a newDocumentBuilderFactoryand 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 aTransformerFactoryand configures it for secure processing. This method uses the JAXP Lookup Mechanism to determine theTransformerFactoryimplementation 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 aDocumentBuilderFactoryand 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 givenSchemaFactoryfor secure XML processing.- Throws:
IllegalArgumentException- If no implementation of the schema language is available.NullPointerException- If theschemaLanguageparameter 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 givenTransformerFactoryfor 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 givenXMLInputFactoryfor 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 givenXMLOutputFactoryfor secure XML processing.- Returns:
- An XML output factory that is secure.
- Throws:
FactoryConfigurationError- If a configuration error is encountered.- Since:
- 8.4.0
-
-