/*
* The contents of this file are subject to the terms
* of the Common Development and Distribution License
* (the "License"). You may not use this file except
* in compliance with the License.
*
* You can obtain a copy of the license at
* https://jaxp.dev.java.net/CDDLv1.0.html.
* See the License for the specific language governing
* permissions and limitations under the License.
*
* When distributing Covered Code, include this CDDL
* HEADER in each file and include the License file at
* https://jaxp.dev.java.net/CDDLv1.0.html
* If applicable add the following below this CDDL HEADER
* with the fields enclosed by brackets "[]" replaced with
* your own identifying information: Portions Copyright
* [year] [name of copyright owner]
*/
/*
* $Id: XMLEntityReader.java,v 1.3 2005/11/03 17:02:21 jeffsuttor Exp $
* @(#)SchemaFactoryFinder.java 1.18 05/11/17
*
* Copyright 2006 Sun Microsystems, Inc. All Rights Reserved.
*/
package javax.xml.validation;
import java.io.BufferedReader;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.lang.reflect.Method;
import java.lang.reflect.InvocationTargetException;
import java.net.URL;
import java.util.ArrayList;
import java.util.Enumeration;
import java.util.Iterator;
import java.util.NoSuchElementException;
import java.util.Properties;
/**
* Implementation of {@link SchemaFactory#newInstance(String)}.
*
* @author <a href="Kohsuke.Kawaguchi@Sun.com">Kohsuke Kawaguchi</a>
* @version $Revision: 1.5 $, $Date: 2005/10/06 05:39:24 $
* @since 1.5
*/
class SchemaFactoryFinder {
/** debug support code. */
private static boolean debug = false;
/**
*<p> Take care of restrictions imposed by java security model </p>
*/
private static SecuritySupport ss = new SecuritySupport();
/**
* <p>Cache properties for performance.</p>
*/
private static Properties cacheProps = new Properties();
/**
* <p>First time requires initialization overhead.</p>
*/
private static boolean firstTime = true;
static {
// Use try/catch block to support applets
try {
debug = ss.getSystemProperty("jaxp.debug") != null;
} catch (Exception _) {
debug = false;
}
}
/**
* <p>Conditional debug printing.</p>
*
* @param msg to print
*/
private static void debugPrintln(String msg) {
if (debug) {
System.err.println("JAXP: " + msg);
}
}
/**
* <p><code>ClassLoader</code> to use to find <code>SchemaFactory</code>.</p>
*/
private final ClassLoader classLoader;
/**
* <p>Constructor that specifies <code>ClassLoader</code> to use
* to find <code>SchemaFactory</code>.</p>
*
* @param loader
* to be used to load resource, {@link SchemaFactory}, and
* {@link SchemaFactoryLoader} implementations during
=1= |