Methods Summary |
---|
public boolean | getFeature(java.lang.String name)returns the particular property requested for in the underlying
implementation of org.xml.sax.XMLReader.
if (name == null) {
throw new NullPointerException();
}
if (name.equals(XMLConstants.FEATURE_SECURE_PROCESSING)) {
return fSecureProcess;
}
else if (name.equals(NAMESPACES_FEATURE)) {
return isNamespaceAware();
}
else if (name.equals(VALIDATION_FEATURE)) {
return isValidating();
}
else if (name.equals(XINCLUDE_FEATURE)) {
return isXIncludeAware();
}
// Check for valid name by creating a dummy XMLReader to get
// feature value
return newSAXParserImpl().getXMLReader().getFeature(name);
|
public javax.xml.validation.Schema | getSchema()
return grammar;
|
public boolean | isXIncludeAware()
return this.isXIncludeAware;
|
public javax.xml.parsers.SAXParser | newSAXParser()Creates a new instance of SAXParser using the currently
configured factory parameters.
SAXParser saxParserImpl;
try {
saxParserImpl = new SAXParserImpl(this, features, fSecureProcess);
}
catch (SAXException se) {
// Translate to ParserConfigurationException
throw new ParserConfigurationException(se.getMessage());
}
return saxParserImpl;
|
private SAXParserImpl | newSAXParserImpl()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 void | setFeature(java.lang.String name, boolean value)Sets the particular feature in the underlying implementation of
org.xml.sax.XMLReader.
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;
}
|
public void | setSchema(javax.xml.validation.Schema grammar)
this.grammar = grammar;
|
public void | setXIncludeAware(boolean state)
this.isXIncludeAware = state;
|