org.codehaus.spice.configkit
Class ComponentConfigUtil
java.lang.Object
|
+--org.codehaus.spice.configkit.ComponentConfigUtil
- public class ComponentConfigUtil
- extends Object
Utility class to get ConfigValidator objects for components. See getComponentConfigValidator(java.lang.String, java.lang.ClassLoader, java.lang.String, java.lang.String)
for a detailed explanation about how
ConfigValidator objects are loaded.
- Version:
- $Revision: 1.1 $ $Date: 2003/12/03 03:19:28 $
- Author:
- Peter Donald
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ComponentConfigUtil
public ComponentConfigUtil()
getComponentConfigValidator
public static ConfigValidator getComponentConfigValidator(String classname,
ClassLoader classLoader,
String location,
String type)
throws Exception
- Return the ConfigValidator for specified component. The component is
specified by classname and classloader. The ConfigValidator is loaded
from specified location and has specified type. If the type is null then
ConfigKit will attempt to guess the type based on schema location. The
location parameter can be relative to the component (ie FooSchema.xml for
class com.biz.Bar will load resource "/com/biz/FooSchema.xml" from
classloader), absolute resource location in classloader (must start with
"/") or null. If the location is null then it will assume resource name
is the same name as class with the postfix "-schema.xml" added to
classname. If no such resource is located in the ClassLoader then null is
returned.
- Parameters:
classname
- the classname of componentclassLoader
- the classloader component loaded fromlocation
- the location of schematype
- the type of schema
- Returns:
- the ConfigValidator
- Throws:
Exception
- if error creating validator
Copyright © 2003 Codehaus. All Rights Reserved.