protected static class

SecureGenericXMLFactory.SecureSAXParserFactory

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

Class Overview

Wraps an existing SAXParserFactory and ensures that any returned SAXParser instances are secure.

Summary

[Expand]
Inherited Constants
From class javax.xml.parsers.SAXParserFactory
Fields
private SAXParserFactory factory
[Expand]
Inherited Fields
From class javax.xml.parsers.SAXParserFactory
Protected Constructors
SecureGenericXMLFactory.SecureSAXParserFactory(SAXParserFactory factory)
Constructs a new SecureSAXParserFactory instance that delegates most functionality to an existing instance, but overrides where needed to protect against XXE attacks.
Public Methods
boolean getFeature(String name)
Schema getSchema()
boolean isNamespaceAware()
boolean isValidating()
boolean isXIncludeAware()
SAXParser newSAXParser()
void setFeature(String name, boolean value)
void setNamespaceAware(boolean awareness)
void setSchema(Schema schema)
void setValidating(boolean validating)
void setXIncludeAware(boolean state)
[Expand]
Inherited Methods
From class javax.xml.parsers.SAXParserFactory
From class java.lang.Object

Fields

private SAXParserFactory factory

Protected Constructors

protected SecureGenericXMLFactory.SecureSAXParserFactory (SAXParserFactory factory)

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

Parameters
factory The existing SAXParserFactory that should be secured.
Throws
ParserConfigurationException on configuration errors.
SAXException on configuration failures.

Public Methods

public boolean getFeature (String name)

Parameters
name
Throws
ParserConfigurationException
SAXNotRecognizedException
SAXNotSupportedException

public Schema getSchema ()

Throws
UnsupportedOperationException

public boolean isNamespaceAware ()

public boolean isValidating ()

public boolean isXIncludeAware ()

Throws
UnsupportedOperationException

public SAXParser newSAXParser ()

Throws
ParserConfigurationException
SAXException

public void setFeature (String name, boolean value)

Parameters
name
value
Throws
ParserConfigurationException
SAXNotRecognizedException
SAXNotSupportedException

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