--- old/src/javax/xml/parsers/SAXParserFactory.java 2012-12-03 12:08:22.000000000 +0100 +++ new/src/javax/xml/parsers/SAXParserFactory.java 2012-12-03 12:08:22.000000000 +0100 @@ -42,8 +42,6 @@ * */ public abstract class SAXParserFactory { - /** The default property name according to the JAXP spec */ - private static final String DEFAULT_PROPERTY_NAME = "javax.xml.parsers.SAXParserFactory"; /** *
Should Parsers be validating?
@@ -87,11 +85,17 @@ * of any property in jaxp.properties after it has been read for the first time. * *META-INF/services/javax.xml.parsers.SAXParserFactory
- * in jars available to the runtime.
+ * Uses the service-provider loading facilities, defined by the
+ * {@link java.util.ServiceLoader} class, to attempt to locate and load an
+ * implementation of the service. If there are providers other than the
+ * implementation specific default located, then the first provider that is
+ * not the default is instantiated and returned;
+ * Otherwise the default implementation is returned if it is on the
+ * classpath or installed as a module.
+ * SAXParserFactory
instance.
@@ -122,16 +126,11 @@
*/
public static SAXParserFactory newInstance() {
- try {
- return (SAXParserFactory) FactoryFinder.find(
+ return FactoryFinder.find(
/* The default property name according to the JAXP spec */
- "javax.xml.parsers.SAXParserFactory",
+ SAXParserFactory.class,
/* The fallback implementation class name */
"com.sun.org.apache.xerces.internal.jaxp.SAXParserFactoryImpl");
- } catch (FactoryFinder.ConfigurationError e) {
- throw new FactoryConfigurationError(e.getException(),
- e.getMessage());
- }
}
/**
@@ -169,13 +168,8 @@
* @since 1.6
*/
public static SAXParserFactory newInstance(String factoryClassName, ClassLoader classLoader){
- try {
//do not fallback if given classloader can't find the class, throw exception
return (SAXParserFactory) FactoryFinder.newInstance(factoryClassName, classLoader, false);
- } catch (FactoryFinder.ConfigurationError e) {
- throw new FactoryConfigurationError(e.getException(),
- e.getMessage());
- }
}
/**
@@ -266,22 +260,22 @@
* A list of the core features and properties can be found at
* http://www.saxproject.org/
*
- * All implementations are required to support the {@link javax.xml.XMLConstants#FEATURE_SECURE_PROCESSING} feature. - * When the feature is
- *true
: the implementation will limit XML processing to conform to implementation limits.
- * Examples include enity expansion limits and XML Schema constructs that would consume large amounts of resources.
- * If XML processing is limited for security reasons, it will be reported via a call to the registered
- * {@link org.xml.sax.ErrorHandler#fatalError(SAXParseException exception)}.
- * See {@link SAXParser} parse
methods for handler specification.
- * false
, the implementation will processing XML according to the XML specifications without
- * regard to possible implementation limits.
- * All implementations are required to support the {@link javax.xml.XMLConstants#FEATURE_SECURE_PROCESSING} feature. + * When the feature is
+ *true
: the implementation will limit XML processing to conform to implementation limits.
+ * Examples include enity expansion limits and XML Schema constructs that would consume large amounts of resources.
+ * If XML processing is limited for security reasons, it will be reported via a call to the registered
+ * {@link org.xml.sax.ErrorHandler#fatalError(SAXParseException exception)}.
+ * See {@link SAXParser} parse
methods for handler specification.
+ * false
, the implementation will processing XML according to the XML specifications without
+ * regard to possible implementation limits.
+ * Get current state of canonicalization.
- * - * @return current state canonicalization control - */ - /* - public boolean getCanonicalization() { - return canonicalState; - } - */ - /** * Gets the {@link Schema} object specified through * the {@link #setSchema(Schema schema)} method. @@ -357,17 +340,6 @@ ); } - /**Set canonicalization control to true
or
- * false.
Set the {@link Schema} to be used by parsers created * from this factory.