@ProviderType public class ConcurrentSAXParserFactory extends SAXParserFactory
This class serves as an alternative to the SAXParserFactory that is provided by the JRE and provides the
following benefits: 1) The static newSAXParser() method does not suffer from the performance problem of
obtaining parser implementations from the classpath, and 2) Since newSAXParser() can be called without
performance concerns, multi-threaded environments (like web applications and portlets) can feel free to call the
method as much as required in each request, in order to maintain thread-safety. The drawback is that the SAXParserImpl class does not fully implement all of the functionality of the one provided by the JRE.
For more information about the performance issues of the implementation provided by the JRE, see Reuse parser instances with the Xerces2 SAX and DOM implementations.
| Modifier | Constructor and Description |
|---|---|
protected |
ConcurrentSAXParserFactory() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
getFeature(String name) |
static SAXParserFactory |
newInstance() |
SAXParser |
newSAXParser() |
void |
setFeature(String name,
boolean value) |
getSchema, isNamespaceAware, isValidating, isXIncludeAware, newInstance, setNamespaceAware, setSchema, setValidating, setXIncludeAwarepublic static SAXParserFactory newInstance()
public boolean getFeature(String name) throws ParserConfigurationException, SAXNotRecognizedException, SAXNotSupportedException
getFeature in class SAXParserFactoryParserConfigurationExceptionSAXNotRecognizedExceptionSAXNotSupportedExceptionpublic SAXParser newSAXParser() throws ParserConfigurationException, SAXException
newSAXParser in class SAXParserFactoryParserConfigurationExceptionSAXExceptionpublic void setFeature(String name, boolean value) throws ParserConfigurationException, SAXNotRecognizedException, SAXNotSupportedException
setFeature in class SAXParserFactoryParserConfigurationExceptionSAXNotRecognizedExceptionSAXNotSupportedExceptionCopyright © 2020 Liferay, Inc.. All rights reserved.