Package com.sun.xml.bind.v2.util
Class XmlFactory
- java.lang.Object
-
- com.sun.xml.bind.v2.util.XmlFactory
-
public class XmlFactory extends java.lang.ObjectProvides helper methods for creating properly configured XML parser factory instances with namespace support turned on and configured for security.- Author:
- snajper
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringACCESS_EXTERNAL_DTDstatic java.lang.StringACCESS_EXTERNAL_SCHEMA
-
Constructor Summary
Constructors Constructor Description XmlFactory()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static javax.xml.validation.SchemaFactoryallowExternalAccess(javax.xml.validation.SchemaFactory sf, java.lang.String value, boolean disableSecureProcessing)static javax.xml.validation.SchemaFactoryallowExternalDTDAccess(javax.xml.validation.SchemaFactory sf, java.lang.String value, boolean disableSecureProcessing)static javax.xml.parsers.DocumentBuilderFactorycreateDocumentBuilderFactory(boolean disableSecureProcessing)Returns properly configured (e.g.static javax.xml.parsers.SAXParserFactorycreateParserFactory(boolean disableSecureProcessing)Returns properly configured (e.g.static javax.xml.validation.SchemaFactorycreateSchemaFactory(java.lang.String language, boolean disableSecureProcessing)Returns properly configured (e.g.static javax.xml.transform.TransformerFactorycreateTransformerFactory(boolean disableSecureProcessing)Returns properly configured (e.g.static javax.xml.xpath.XPathFactorycreateXPathFactory(boolean disableSecureProcessing)Returns properly configured (e.g.
-
-
-
Field Detail
-
ACCESS_EXTERNAL_SCHEMA
public static final java.lang.String ACCESS_EXTERNAL_SCHEMA
- See Also:
- Constant Field Values
-
ACCESS_EXTERNAL_DTD
public static final java.lang.String ACCESS_EXTERNAL_DTD
- See Also:
- Constant Field Values
-
-
Method Detail
-
createSchemaFactory
public static javax.xml.validation.SchemaFactory createSchemaFactory(java.lang.String language, boolean disableSecureProcessing) throws java.lang.IllegalStateExceptionReturns properly configured (e.g. security features) schema factory - namespaceAware == true - securityProcessing == is set based on security processing property, default is true- Throws:
java.lang.IllegalStateException
-
createParserFactory
public static javax.xml.parsers.SAXParserFactory createParserFactory(boolean disableSecureProcessing) throws java.lang.IllegalStateExceptionReturns properly configured (e.g. security features) parser factory - namespaceAware == true - securityProcessing == is set based on security processing property, default is true- Throws:
java.lang.IllegalStateException
-
createXPathFactory
public static javax.xml.xpath.XPathFactory createXPathFactory(boolean disableSecureProcessing) throws java.lang.IllegalStateExceptionReturns properly configured (e.g. security features) factory - securityProcessing == is set based on security processing property, default is true- Throws:
java.lang.IllegalStateException
-
createTransformerFactory
public static javax.xml.transform.TransformerFactory createTransformerFactory(boolean disableSecureProcessing) throws java.lang.IllegalStateExceptionReturns properly configured (e.g. security features) factory - securityProcessing == is set based on security processing property, default is true- Throws:
java.lang.IllegalStateException
-
createDocumentBuilderFactory
public static javax.xml.parsers.DocumentBuilderFactory createDocumentBuilderFactory(boolean disableSecureProcessing) throws java.lang.IllegalStateExceptionReturns properly configured (e.g. security features) factory - namespaceAware == true - securityProcessing == is set based on security processing property, default is true- Throws:
java.lang.IllegalStateException
-
allowExternalAccess
public static javax.xml.validation.SchemaFactory allowExternalAccess(javax.xml.validation.SchemaFactory sf, java.lang.String value, boolean disableSecureProcessing)
-
allowExternalDTDAccess
public static javax.xml.validation.SchemaFactory allowExternalDTDAccess(javax.xml.validation.SchemaFactory sf, java.lang.String value, boolean disableSecureProcessing)
-
-