protected static class SecureGenericXMLFactory.SecureDocumentBuilderFactory
extends javax.xml.parsers.DocumentBuilderFactory
Modifier | Constructor and Description |
---|---|
protected |
SecureGenericXMLFactory.SecureDocumentBuilderFactory(javax.xml.parsers.DocumentBuilderFactory factory)
Constructs a new SecureDocumentBuilderFactory instance that delegates
most functionality to an existing instance, but overrides where
needed to protect against XXE attacks.
|
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
getAttribute(java.lang.String name) |
boolean |
getFeature(java.lang.String name) |
javax.xml.validation.Schema |
getSchema() |
boolean |
isCoalescing() |
boolean |
isExpandEntityReferences() |
boolean |
isIgnoringComments() |
boolean |
isIgnoringElementContentWhitespace() |
boolean |
isIncludeAware() |
boolean |
isNamespaceAware() |
boolean |
isValidating() |
javax.xml.parsers.DocumentBuilder |
newDocumentBuilder() |
void |
setAttribute(java.lang.String name,
java.lang.Object value) |
void |
setCoalescing(boolean coalescing) |
void |
setExpandEntityReferences(boolean expandEntityRef) |
void |
setFeature(java.lang.String name,
boolean value) |
void |
setIgnoringComments(boolean ignoreComments) |
void |
setIgnoringElementContentWhitespace(boolean whitespace) |
void |
setNamespaceAware(boolean awareness) |
void |
setSchema(javax.xml.validation.Schema schema) |
void |
setValidating(boolean validating) |
void |
setXIncludeAware(boolean state) |
protected SecureGenericXMLFactory.SecureDocumentBuilderFactory(javax.xml.parsers.DocumentBuilderFactory factory)
factory
- the existing DocumentBuilderFactory that should be
secured.public javax.xml.parsers.DocumentBuilder newDocumentBuilder() throws javax.xml.parsers.ParserConfigurationException
newDocumentBuilder
in class javax.xml.parsers.DocumentBuilderFactory
javax.xml.parsers.ParserConfigurationException
public void setNamespaceAware(boolean awareness)
setNamespaceAware
in class javax.xml.parsers.DocumentBuilderFactory
public void setValidating(boolean validating)
setValidating
in class javax.xml.parsers.DocumentBuilderFactory
public void setIgnoringElementContentWhitespace(boolean whitespace)
setIgnoringElementContentWhitespace
in class javax.xml.parsers.DocumentBuilderFactory
public void setExpandEntityReferences(boolean expandEntityRef)
setExpandEntityReferences
in class javax.xml.parsers.DocumentBuilderFactory
public void setIgnoringComments(boolean ignoreComments)
setIgnoringComments
in class javax.xml.parsers.DocumentBuilderFactory
public void setCoalescing(boolean coalescing)
setCoalescing
in class javax.xml.parsers.DocumentBuilderFactory
public boolean isNamespaceAware()
isNamespaceAware
in class javax.xml.parsers.DocumentBuilderFactory
public boolean isValidating()
isValidating
in class javax.xml.parsers.DocumentBuilderFactory
public boolean isIgnoringElementContentWhitespace()
isIgnoringElementContentWhitespace
in class javax.xml.parsers.DocumentBuilderFactory
public boolean isExpandEntityReferences()
isExpandEntityReferences
in class javax.xml.parsers.DocumentBuilderFactory
public boolean isIgnoringComments()
isIgnoringComments
in class javax.xml.parsers.DocumentBuilderFactory
public boolean isCoalescing()
isCoalescing
in class javax.xml.parsers.DocumentBuilderFactory
public void setAttribute(java.lang.String name, java.lang.Object value) throws java.lang.IllegalArgumentException
setAttribute
in class javax.xml.parsers.DocumentBuilderFactory
java.lang.IllegalArgumentException
public java.lang.Object getAttribute(java.lang.String name) throws java.lang.IllegalArgumentException
getAttribute
in class javax.xml.parsers.DocumentBuilderFactory
java.lang.IllegalArgumentException
public void setFeature(java.lang.String name, boolean value) throws javax.xml.parsers.ParserConfigurationException
setFeature
in class javax.xml.parsers.DocumentBuilderFactory
javax.xml.parsers.ParserConfigurationException
public boolean getFeature(java.lang.String name) throws javax.xml.parsers.ParserConfigurationException
getFeature
in class javax.xml.parsers.DocumentBuilderFactory
javax.xml.parsers.ParserConfigurationException
public javax.xml.validation.Schema getSchema() throws java.lang.UnsupportedOperationException
getSchema
in class javax.xml.parsers.DocumentBuilderFactory
java.lang.UnsupportedOperationException
public void setSchema(javax.xml.validation.Schema schema) throws java.lang.UnsupportedOperationException
setSchema
in class javax.xml.parsers.DocumentBuilderFactory
java.lang.UnsupportedOperationException
public void setXIncludeAware(boolean state) throws java.lang.UnsupportedOperationException
setXIncludeAware
in class javax.xml.parsers.DocumentBuilderFactory
java.lang.UnsupportedOperationException
public boolean isIncludeAware() throws java.lang.UnsupportedOperationException
java.lang.UnsupportedOperationException