Methods Summary |
---|
public boolean | getFeature(java.lang.String name)
if (name == null) {
throw new NullPointerException();
}
if (!name.startsWith("http://xml.org/sax/features/")) {
throw new SAXNotRecognizedException(name);
}
return Boolean.TRUE.equals(features.get(name));
|
public boolean | isNamespaceAware()
try {
return getFeature(NAMESPACES);
} catch (SAXNotRecognizedException ex) {
throw new AssertionError(ex);
}
|
public boolean | isValidating()
try {
return getFeature(VALIDATION);
} catch (SAXNotRecognizedException ex) {
throw new AssertionError(ex);
}
|
public javax.xml.parsers.SAXParser | newSAXParser()
if (isValidating()) {
throw new ParserConfigurationException(
"No validating SAXParser implementation available");
}
try {
return new SAXParserImpl(features);
} catch (Exception ex) {
throw new ParserConfigurationException(ex.toString());
}
|
public void | setFeature(java.lang.String name, boolean value)
if (name == null) {
throw new NullPointerException();
}
if (!name.startsWith("http://xml.org/sax/features/")) {
throw new SAXNotRecognizedException(name);
}
if (value) {
features.put(name, Boolean.TRUE);
} else {
// This is needed to disable features that are enabled by default.
features.put(name, Boolean.FALSE);
}
|
public void | setNamespaceAware(boolean value)
try {
setFeature(NAMESPACES, value);
} catch (SAXNotRecognizedException ex) {
throw new AssertionError(ex);
}
|
public void | setValidating(boolean value)
try {
setFeature(VALIDATION, value);
} catch (SAXNotRecognizedException ex) {
throw new AssertionError(ex);
}
|