src/javax/xml/validation/SchemaFactory.java

Print this page

        

*** 104,113 **** --- 104,114 ---- * </table> * * @author <a href="mailto:Kohsuke.Kawaguchi@Sun.com">Kohsuke Kawaguchi</a> * @author <a href="mailto:Neeraj.Bajaj@sun.com">Neeraj Bajaj</a> * + * @version $Revision: 1.10 $, $Date: 2010-11-01 04:36:13 $ * @since 1.5 */ public abstract class SchemaFactory { private static SecuritySupport ss = new SecuritySupport();
*** 145,162 **** * <code>$java.home/lib/jaxp.properties</code> is read and * the value associated with the key being the system property above * is looked for. If present, the value is processed just like above. * </li> * <li> ! * <p>The class loader is asked for service provider provider-configuration files matching ! * <code>javax.xml.validation.SchemaFactory</code> in the resource directory META-INF/services. ! * See the JAR File Specification for file format and parsing rules. * Each potential service provider is required to implement the method:</p> * <pre> * {@link #isSchemaLanguageSupported(String schemaLanguage)} * </pre> ! * The first service provider found in class loader order that supports the specified schema language is returned. * </li> * <li> * Platform default <code>SchemaFactory</code> is located * in a implementation specific way. There must be a platform default * <code>SchemaFactory</code> for W3C XML Schema. --- 146,169 ---- * <code>$java.home/lib/jaxp.properties</code> is read and * the value associated with the key being the system property above * is looked for. If present, the value is processed just like above. * </li> * <li> ! * <p>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. * Each potential service provider is required to implement the method:</p> * <pre> * {@link #isSchemaLanguageSupported(String schemaLanguage)} * </pre> ! * A service provider is deemed as valid if it supports the specified schema language. ! * ! * <p>In case of multiple providers, the first non-default implementation shall be ! * instantiated and returned. The default implementation is returned if it is ! * the only one found by the service loader.</p> ! * <p> ! * If a misconfigured provider is encountered and {@link java.util.ServiceConfigurationError} is thrown, ! * the error will be wrapped in a {@link javax.xml.validation.FactoryConfigurationError}.</p> * </li> * <li> * Platform default <code>SchemaFactory</code> is located * in a implementation specific way. There must be a platform default * <code>SchemaFactory</code> for W3C XML Schema.
*** 184,207 **** * * @throws IllegalArgumentException * If no implementation of the schema language is available. * @throws NullPointerException * If the <code>schemaLanguage</code> parameter is null. * * @see #newInstance(String schemaLanguage, String factoryClassName, ClassLoader classLoader) */ ! public static final SchemaFactory newInstance(String schemaLanguage) { ClassLoader cl; cl = ss.getContextClassLoader(); if (cl == null) { //cl = ClassLoader.getSystemClassLoader(); //use the current class loader cl = SchemaFactory.class.getClassLoader(); } ! SchemaFactory f = new SchemaFactoryFinder(cl).newFactory(schemaLanguage); if (f == null) { throw new IllegalArgumentException( "No SchemaFactory" + " that implements the schema language specified by: " + schemaLanguage + " could be loaded"); --- 191,222 ---- * * @throws IllegalArgumentException * If no implementation of the schema language is available. * @throws NullPointerException * If the <code>schemaLanguage</code> parameter is null. + * @throws FactoryConfigurationError + * If a misconfigured provider is encountered * * @see #newInstance(String schemaLanguage, String factoryClassName, ClassLoader classLoader) */ ! public static final SchemaFactory newInstance(String schemaLanguage) ! { ClassLoader cl; cl = ss.getContextClassLoader(); if (cl == null) { //cl = ClassLoader.getSystemClassLoader(); //use the current class loader cl = SchemaFactory.class.getClassLoader(); } ! SchemaFactory f = null; ! try { ! f = new SchemaFactoryFinder(cl).newFactory(schemaLanguage); ! } catch (FactoryConfigurationError e) { ! throw e; ! } if (f == null) { throw new IllegalArgumentException( "No SchemaFactory" + " that implements the schema language specified by: " + schemaLanguage + " could be loaded");