src/com/sun/org/apache/xerces/internal/parsers/SAXParser.java
Print this page
*** 20,31 ****
--- 20,34 ----
package com.sun.org.apache.xerces.internal.parsers;
import com.sun.org.apache.xerces.internal.impl.Constants;
import com.sun.org.apache.xerces.internal.util.SymbolTable;
+ import com.sun.org.apache.xerces.internal.utils.XMLSecurityPropertyManager;
import com.sun.org.apache.xerces.internal.xni.grammars.XMLGrammarPool;
import com.sun.org.apache.xerces.internal.xni.parser.XMLParserConfiguration;
+ import org.xml.sax.SAXNotRecognizedException;
+ import org.xml.sax.SAXNotSupportedException;
/**
* This is the main Xerces SAX parser class. It uses the abstract SAX
* parser with a document scanner, a dtd scanner, and a validator, as
* well as a grammar pool.
*** 118,123 ****
--- 121,146 ----
fConfiguration.setProperty(XMLGRAMMAR_POOL, grammarPool);
}
} // <init>(SymbolTable,XMLGrammarPool)
+ /**
+ * Sets the particular property in the underlying implementation of
+ * org.xml.sax.XMLReader.
+ */
+ public void setProperty(String name, Object value)
+ throws SAXNotRecognizedException, SAXNotSupportedException {
+ XMLSecurityPropertyManager spm = new XMLSecurityPropertyManager();
+ int index = spm.getIndex(name);
+ if (index > -1) {
+ /**
+ * this is a direct call to this parser, not a subclass since
+ * internally the support of this property is done through
+ * XMLSecurityPropertyManager
+ */
+ spm.setValue(index, XMLSecurityPropertyManager.State.APIPROPERTY, (String)value);
+ super.setProperty(Constants.XML_SECURITY_PROPERTY_MANAGER, spm);
+ } else {
+ super.setProperty(name, value);
+ }
+ }
} // class SAXParser