org.freehep.util
Class Factory
java.lang.Object
org.freehep.util.Factory
public class Factory
- extends Object
Methods to use factories (a la JAXP).
- Version:
- $Id: Factory.java 8584 2006-08-10 23:06:37Z duns $
- Author:
- Mark Donszelmann
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
findFactory
public static String findFactory(String factoryName,
String factoryFile,
String defaultFactory)
- Find the correct factory name, based on the following procedure:
- Use the specified system property: factoryName.
- Use the specified property file in JAVA_HOME/lib/ and the
specified property: factoryName.
- Use the Services API (as detailed in the JAR specification) to look
for the classname in META-INF/services/.
- Use the specfied default factory: defaultFactory.
- Parameters:
factoryName
- name to be used for lookupfactoryFile
- filename to look for in JAVA_HOME/libdefaultFactory
- name of the default factory
- Returns:
- the name of the factory according to the procedure above
loadFactory
public static Object loadFactory(String name,
String file,
String defaultImplementation)
Copyright © 2012. All Rights Reserved.