Code example for Hashtable

Methods: put, remove

0
        throws ParserConfigurationException, SAXNotRecognizedException,  
        SAXNotSupportedException { 
         
        SAXParserImpl saxParserImpl;
        try { 
            saxParserImpl = new SAXParserImpl(this, features);
        } catch (SAXNotSupportedException e) {
            throw e;
        } catch (SAXNotRecognizedException e) {
            throw e;
        } catch (SAXException se) {
            throw new ParserConfigurationException(se.getMessage());
        } 
        return saxParserImpl;
    } 
 
    /** 
     * Sets the particular feature in the underlying implementation of  
     * org.xml.sax.XMLReader. 
     */ 
    public void setFeature(String name, boolean value)
        throws ParserConfigurationException, SAXNotRecognizedException,  
		SAXNotSupportedException { 
        if (name == null) {
            throw new NullPointerException();
        } 
        // If this is the secure processing feature, save it then return. 
        if (name.equals(XMLConstants.FEATURE_SECURE_PROCESSING)) {
            fSecureProcess = value;
            return; 
        } 
        // Keep built-in settings in synch with the feature values. 
        else if (name.equals(NAMESPACES_FEATURE)) {
            setNamespaceAware(value);
            return; 
        } 
        else if (name.equals(VALIDATION_FEATURE)) {
            setValidating(value);
            return; 
        } 
        else if (name.equals(XINCLUDE_FEATURE)) {
            setXIncludeAware(value);
            return; 
        } 
         
        // XXX This is ugly.  We have to collect the features and then 
        // later create an XMLReader to verify the features. 
        if (features == null) {
            features = new Hashtable();
        } 
        features.put(name, value ? Boolean.TRUE : Boolean.FALSE);
 
        // Test the feature by possibly throwing SAX exceptions 
        try { 
            newSAXParserImpl(); 
        }  
        catch (SAXNotSupportedException e) {
            features.remove(name);
            throw e;
        }  
        catch (SAXNotRecognizedException e) {
            features.remove(name);
            throw e;
        } 
    } 
 
    /**