public class DocumentBuilderFactoryBuilder
extends java.lang.Object
DocumentBuilderFactory
.In the adapter configuration file this class is aliased as xml-document-builder-configuration which is the preferred alternative to the fully qualified classname when building your configuration.
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
DISABLE_DOCTYP |
Constructor and Description |
---|
DocumentBuilderFactoryBuilder() |
Modifier and Type | Method and Description |
---|---|
DocumentBuilderFactoryBuilder |
addFeature(java.lang.String featureName,
java.lang.Boolean value) |
javax.xml.parsers.DocumentBuilderFactory |
build() |
javax.xml.parsers.DocumentBuilder |
configure(javax.xml.parsers.DocumentBuilder db)
Configure a document builder.
|
javax.xml.parsers.DocumentBuilderFactory |
configure(javax.xml.parsers.DocumentBuilderFactory f)
Configure a document builder factory
|
java.lang.Boolean |
getCoalescing() |
org.xml.sax.EntityResolver |
getEntityResolver() |
java.lang.Boolean |
getExpandEntityReferences() |
KeyValuePairSet |
getFeatures() |
java.lang.Boolean |
getIgnoreComments() |
java.lang.Boolean |
getIgnoreWhitespace() |
java.lang.Boolean |
getNamespaceAware() |
java.lang.Boolean |
getValidating() |
java.lang.Boolean |
getXincludeAware() |
javax.xml.parsers.DocumentBuilder |
newDocumentBuilder(javax.xml.parsers.DocumentBuilderFactory f)
Convenience to create a new
DocumentBuilder instance. |
static DocumentBuilderFactoryBuilder |
newInstance()
Create a new instance that is namespace aware.
|
static DocumentBuilderFactoryBuilder |
newInstance(DocumentBuilderFactoryBuilder b)
Convenient method for null protection.
|
static DocumentBuilderFactoryBuilder |
newInstance(DocumentBuilderFactoryBuilder b,
javax.xml.namespace.NamespaceContext ctx)
Convenient method for null protection.
|
static DocumentBuilderFactoryBuilder |
newRestrictedInstance()
Create a New instance that disables Entityrefs and also mitigates against XXE via
http://apache.org/xml/features/disallow-doctype-decl = true . |
static DocumentBuilderFactoryBuilder |
newRestrictedInstance(DocumentBuilderFactoryBuilder b)
Convenient method for null protection.
|
void |
setCoalescing(java.lang.Boolean coalescing)
Maps to
DocumentBuilderFactory.setCoalescing(boolean) . |
void |
setEntityResolver(org.xml.sax.EntityResolver e) |
void |
setExpandEntityReferences(java.lang.Boolean expandEntityReferences)
Maps to
DocumentBuilderFactory.setExpandEntityReferences(boolean) . |
void |
setFeatures(KeyValuePairSet features)
Set the features.
|
void |
setIgnoreComments(java.lang.Boolean ignoreComments)
Maps to
DocumentBuilderFactory.setIgnoringComments(boolean) . |
void |
setIgnoreWhitespace(java.lang.Boolean ignoreWhitespace)
Maps to
DocumentBuilderFactory.setIgnoringElementContentWhitespace(boolean) . |
void |
setNamespaceAware(java.lang.Boolean namespaceAware)
Maps to
DocumentBuilderFactory.setNamespaceAware(boolean) . |
void |
setValidating(java.lang.Boolean validate)
Maps to
DocumentBuilderFactory.setValidating(boolean) . |
void |
setXincludeAware(java.lang.Boolean xincludeAware)
Maps to
DocumentBuilderFactory.setXIncludeAware(boolean) . |
DocumentBuilderFactoryBuilder |
withCoalescing(java.lang.Boolean b) |
DocumentBuilderFactoryBuilder |
withEntityResolver(org.xml.sax.EntityResolver e) |
DocumentBuilderFactoryBuilder |
withExpandEntityReferences(java.lang.Boolean b) |
DocumentBuilderFactoryBuilder |
withFeatures(KeyValuePairSet v) |
DocumentBuilderFactoryBuilder |
withFeatures(java.util.Map<java.lang.String,java.lang.Boolean> f) |
DocumentBuilderFactoryBuilder |
withIgnoreComments(java.lang.Boolean b) |
DocumentBuilderFactoryBuilder |
withIgnoreWhitespace(java.lang.Boolean b) |
DocumentBuilderFactoryBuilder |
withNamespaceAware(java.lang.Boolean b) |
DocumentBuilderFactoryBuilder |
withNamespaceAware(javax.xml.namespace.NamespaceContext b) |
DocumentBuilderFactoryBuilder |
withValidating(java.lang.Boolean b) |
DocumentBuilderFactoryBuilder |
withXIncludeAware(java.lang.Boolean b) |
public static final java.lang.String DISABLE_DOCTYP
public static final DocumentBuilderFactoryBuilder newInstance()
public static final DocumentBuilderFactoryBuilder newRestrictedInstance()
http://apache.org/xml/features/disallow-doctype-decl = true
. This is added as a convenience so you don't have to keep
configuring it if XXE is a bit of a bother for you.public static final DocumentBuilderFactoryBuilder newInstance(DocumentBuilderFactoryBuilder b)
b
- an existing DocumentBuilderFactoryBuilder instance (or null)public static final DocumentBuilderFactoryBuilder newRestrictedInstance(DocumentBuilderFactoryBuilder b)
b
- an existing DocumentBuilderFactoryBuilder instance (or null)newRestrictedInstance()
public static final DocumentBuilderFactoryBuilder newInstance(DocumentBuilderFactoryBuilder b, javax.xml.namespace.NamespaceContext ctx)
public javax.xml.parsers.DocumentBuilderFactory configure(javax.xml.parsers.DocumentBuilderFactory f) throws javax.xml.parsers.ParserConfigurationException
f
- javax.xml.parsers.ParserConfigurationException
public javax.xml.parsers.DocumentBuilder configure(javax.xml.parsers.DocumentBuilder db)
db
- public javax.xml.parsers.DocumentBuilder newDocumentBuilder(javax.xml.parsers.DocumentBuilderFactory f) throws javax.xml.parsers.ParserConfigurationException
DocumentBuilder
instance.f
- a DocumentBuilderFactoryjavax.xml.parsers.ParserConfigurationException
configure(DocumentBuilder)
,
configure(DocumentBuilderFactory)
public javax.xml.parsers.DocumentBuilderFactory build() throws javax.xml.parsers.ParserConfigurationException
javax.xml.parsers.ParserConfigurationException
public KeyValuePairSet getFeatures()
public void setFeatures(KeyValuePairSet features)
features
- the features.public DocumentBuilderFactoryBuilder withFeatures(java.util.Map<java.lang.String,java.lang.Boolean> f)
public DocumentBuilderFactoryBuilder withFeatures(KeyValuePairSet v)
public DocumentBuilderFactoryBuilder addFeature(java.lang.String featureName, java.lang.Boolean value)
public java.lang.Boolean getValidating()
public void setValidating(java.lang.Boolean validate)
DocumentBuilderFactory.setValidating(boolean)
.public DocumentBuilderFactoryBuilder withValidating(java.lang.Boolean b)
public java.lang.Boolean getNamespaceAware()
public void setNamespaceAware(java.lang.Boolean namespaceAware)
DocumentBuilderFactory.setNamespaceAware(boolean)
.public DocumentBuilderFactoryBuilder withNamespaceAware(java.lang.Boolean b)
public DocumentBuilderFactoryBuilder withNamespaceAware(javax.xml.namespace.NamespaceContext b)
public java.lang.Boolean getIgnoreWhitespace()
public void setIgnoreWhitespace(java.lang.Boolean ignoreWhitespace)
DocumentBuilderFactory.setIgnoringElementContentWhitespace(boolean)
.public DocumentBuilderFactoryBuilder withIgnoreWhitespace(java.lang.Boolean b)
public java.lang.Boolean getExpandEntityReferences()
public void setExpandEntityReferences(java.lang.Boolean expandEntityReferences)
DocumentBuilderFactory.setExpandEntityReferences(boolean)
.public DocumentBuilderFactoryBuilder withExpandEntityReferences(java.lang.Boolean b)
public java.lang.Boolean getIgnoreComments()
public void setIgnoreComments(java.lang.Boolean ignoreComments)
DocumentBuilderFactory.setIgnoringComments(boolean)
.public DocumentBuilderFactoryBuilder withIgnoreComments(java.lang.Boolean b)
public java.lang.Boolean getCoalescing()
public void setCoalescing(java.lang.Boolean coalescing)
DocumentBuilderFactory.setCoalescing(boolean)
.public DocumentBuilderFactoryBuilder withCoalescing(java.lang.Boolean b)
public java.lang.Boolean getXincludeAware()
public void setXincludeAware(java.lang.Boolean xincludeAware)
DocumentBuilderFactory.setXIncludeAware(boolean)
.public DocumentBuilderFactoryBuilder withXIncludeAware(java.lang.Boolean b)
public org.xml.sax.EntityResolver getEntityResolver()
public void setEntityResolver(org.xml.sax.EntityResolver e)
public DocumentBuilderFactoryBuilder withEntityResolver(org.xml.sax.EntityResolver e)