protected static class

SecureGenericXMLFactory.SecureDocumentBuilderFactory

extends DocumentBuilderFactory
java.lang.Object
   ↳ javax.xml.parsers.DocumentBuilderFactory
     ↳ com.google.gdata.util.common.xml.parsing.SecureGenericXMLFactory.SecureDocumentBuilderFactory

Class Overview

Wraps an existing DocumentBuilderFactory and ensures that any returned DocumentBuilder instances are secure.

Summary

[Expand]
Inherited Constants
From class javax.xml.parsers.DocumentBuilderFactory
Fields
private DocumentBuilderFactory factory
[Expand]
Inherited Fields
From class javax.xml.parsers.DocumentBuilderFactory
Protected Constructors
SecureGenericXMLFactory.SecureDocumentBuilderFactory(DocumentBuilderFactory factory)
Constructs a new SecureDocumentBuilderFactory instance that delegates most functionality to an existing instance, but overrides where needed to protect against XXE attacks.
Public Methods
Object getAttribute(String name)
boolean getFeature(String name)
Schema getSchema()
boolean isCoalescing()
boolean isExpandEntityReferences()
boolean isIgnoringComments()
boolean isIgnoringElementContentWhitespace()
boolean isIncludeAware()
boolean isNamespaceAware()
boolean isValidating()
DocumentBuilder newDocumentBuilder()
void setAttribute(String name, Object value)
void setCoalescing(boolean coalescing)
void setExpandEntityReferences(boolean expandEntityRef)
void setFeature(String name, boolean value)
void setIgnoringComments(boolean ignoreComments)
void setIgnoringElementContentWhitespace(boolean whitespace)
void setNamespaceAware(boolean awareness)
void setSchema(Schema schema)
void setValidating(boolean validating)
void setXIncludeAware(boolean state)
[Expand]
Inherited Methods
From class javax.xml.parsers.DocumentBuilderFactory
From class java.lang.Object

Fields

private DocumentBuilderFactory factory

Protected Constructors

protected SecureGenericXMLFactory.SecureDocumentBuilderFactory (DocumentBuilderFactory factory)

Constructs a new SecureDocumentBuilderFactory instance that delegates most functionality to an existing instance, but overrides where needed to protect against XXE attacks.

Parameters
factory The existing DocumentBuilderFactory that should be secured.

Public Methods

public Object getAttribute (String name)

Parameters
name
Throws
IllegalArgumentException

public boolean getFeature (String name)

Parameters
name
Throws
ParserConfigurationException

public Schema getSchema ()

Throws
UnsupportedOperationException

public boolean isCoalescing ()

public boolean isExpandEntityReferences ()

public boolean isIgnoringComments ()

public boolean isIgnoringElementContentWhitespace ()

public boolean isIncludeAware ()

Throws
UnsupportedOperationException

public boolean isNamespaceAware ()

public boolean isValidating ()

public DocumentBuilder newDocumentBuilder ()

Throws
ParserConfigurationException

public void setAttribute (String name, Object value)

Parameters
name
value
Throws
IllegalArgumentException

public void setCoalescing (boolean coalescing)

Parameters
coalescing

public void setExpandEntityReferences (boolean expandEntityRef)

Parameters
expandEntityRef

public void setFeature (String name, boolean value)

Parameters
name
value
Throws
ParserConfigurationException

public void setIgnoringComments (boolean ignoreComments)

Parameters
ignoreComments

public void setIgnoringElementContentWhitespace (boolean whitespace)

Parameters
whitespace

public void setNamespaceAware (boolean awareness)

Parameters
awareness

public void setSchema (Schema schema)

Parameters
schema
Throws
UnsupportedOperationException

public void setValidating (boolean validating)

Parameters
validating

public void setXIncludeAware (boolean state)

Parameters
state
Throws
UnsupportedOperationException