FileDocCategorySizeDatePackage
SAXParserFactoryImpl.javaAPI DocJava SE 5 API6643Fri Aug 26 14:55:54 BST 2005com.sun.org.apache.xerces.internal.jaxp

SAXParserFactoryImpl

public class SAXParserFactoryImpl extends SAXParserFactory
This is the implementation specific class for the javax.xml.parsers.SAXParserFactory. This is the platform default implementation for the platform.

Fields Summary
private Hashtable
features
private Schema
grammar
private boolean
isXIncludeAware
Constructors Summary
Methods Summary
public booleangetFeature(java.lang.String name)
returns the particular property requested for in the underlying implementation of org.xml.sax.XMLReader.

        // Check for valid name by creating a dummy XMLReader to get
        // feature value
		if(name.equals(XMLConstants.FEATURE_SECURE_PROCESSING) && features != null){
			Boolean ob =(Boolean) features.get(name);
			if(ob == null )
				return false;
			return ob.booleanValue();
		}
        return newSAXParserImpl().getXMLReader().getFeature(name);
    
public javax.xml.validation.SchemagetSchema()

        return grammar;
    
public booleanisXIncludeAware()

        return this.isXIncludeAware;
    
public javax.xml.parsers.SAXParsernewSAXParser()
Creates a new instance of SAXParser using the currently configured factory parameters.

return
javax.xml.parsers.SAXParser

        SAXParser saxParserImpl;
        try {
            saxParserImpl = new SAXParserImpl(this, features);
        } catch (SAXException se) {
            // Translate to ParserConfigurationException
            throw new ParserConfigurationException(se.getMessage());
        }
        return saxParserImpl;
    
private com.sun.org.apache.xerces.internal.jaxp.SAXParserImplnewSAXParserImpl()
Common code for translating exceptions

        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;
    
public voidsetFeature(java.lang.String name, boolean value)
Sets the particular feature in the underlying implementation of org.xml.sax.XMLReader.

        // 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;
        }
    
public voidsetSchema(javax.xml.validation.Schema grammar)

        this.grammar = grammar;
    
public voidsetXIncludeAware(boolean state)

        this.isXIncludeAware = state;