com.liferay.faces.util.xml
Class SAXParserFactory
java.lang.Object
javax.xml.parsers.SAXParserFactory
com.liferay.faces.util.xml.SAXParserFactory
public class SAXParserFactory
- 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 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.
- Author:
- Neil Griffin
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
SAXParserFactory
protected SAXParserFactory()
newInstance
public static SAXParserFactory newInstance()
newSAXParser
public SAXParser newSAXParser()
throws ParserConfigurationException,
SAXException
- Specified by:
newSAXParser in class SAXParserFactory
- Throws:
ParserConfigurationException
SAXException
getFeature
public boolean getFeature(String name)
throws ParserConfigurationException,
SAXNotRecognizedException,
SAXNotSupportedException
- Specified by:
getFeature in class SAXParserFactory
- Throws:
ParserConfigurationException
SAXNotRecognizedException
SAXNotSupportedException
setFeature
public void setFeature(String name,
boolean value)
throws ParserConfigurationException,
SAXNotRecognizedException,
SAXNotSupportedException
- Specified by:
setFeature in class SAXParserFactory
- Throws:
ParserConfigurationException
SAXNotRecognizedException
SAXNotSupportedException
Copyright © 2014 Liferay, Inc.. All Rights Reserved.