jaxp/src/com/sun/org/apache/xerces/internal/parsers/SAXParser.java
changeset 18890 25bdeca3173b
parent 12458 d601e4bba306
child 20968 dde41f8b7b96
child 19479 e4f3adf06beb
equal deleted inserted replaced
18675:711eb4aa87de 18890:25bdeca3173b
    20 
    20 
    21 package com.sun.org.apache.xerces.internal.parsers;
    21 package com.sun.org.apache.xerces.internal.parsers;
    22 
    22 
    23 import com.sun.org.apache.xerces.internal.impl.Constants;
    23 import com.sun.org.apache.xerces.internal.impl.Constants;
    24 import com.sun.org.apache.xerces.internal.util.SymbolTable;
    24 import com.sun.org.apache.xerces.internal.util.SymbolTable;
       
    25 import com.sun.org.apache.xerces.internal.utils.XMLSecurityPropertyManager;
    25 import com.sun.org.apache.xerces.internal.xni.grammars.XMLGrammarPool;
    26 import com.sun.org.apache.xerces.internal.xni.grammars.XMLGrammarPool;
    26 import com.sun.org.apache.xerces.internal.xni.parser.XMLParserConfiguration;
    27 import com.sun.org.apache.xerces.internal.xni.parser.XMLParserConfiguration;
       
    28 import org.xml.sax.SAXNotRecognizedException;
       
    29 import org.xml.sax.SAXNotSupportedException;
    27 
    30 
    28 /**
    31 /**
    29  * This is the main Xerces SAX parser class. It uses the abstract SAX
    32  * This is the main Xerces SAX parser class. It uses the abstract SAX
    30  * parser with a document scanner, a dtd scanner, and a validator, as
    33  * parser with a document scanner, a dtd scanner, and a validator, as
    31  * well as a grammar pool.
    34  * well as a grammar pool.
   118             fConfiguration.setProperty(XMLGRAMMAR_POOL, grammarPool);
   121             fConfiguration.setProperty(XMLGRAMMAR_POOL, grammarPool);
   119         }
   122         }
   120 
   123 
   121     } // <init>(SymbolTable,XMLGrammarPool)
   124     } // <init>(SymbolTable,XMLGrammarPool)
   122 
   125 
       
   126     /**
       
   127      * Sets the particular property in the underlying implementation of
       
   128      * org.xml.sax.XMLReader.
       
   129      */
       
   130     public void setProperty(String name, Object value)
       
   131         throws SAXNotRecognizedException, SAXNotSupportedException {
       
   132         XMLSecurityPropertyManager spm = new XMLSecurityPropertyManager();
       
   133         int index = spm.getIndex(name);
       
   134         if (index > -1) {
       
   135             /**
       
   136              * this is a direct call to this parser, not a subclass since
       
   137              * internally the support of this property is done through
       
   138              * XMLSecurityPropertyManager
       
   139              */
       
   140             spm.setValue(index, XMLSecurityPropertyManager.State.APIPROPERTY, (String)value);
       
   141             super.setProperty(Constants.XML_SECURITY_PROPERTY_MANAGER, spm);
       
   142         } else {
       
   143             super.setProperty(name, value);
       
   144         }
       
   145     }
   123 } // class SAXParser
   146 } // class SAXParser