org.realityforge.configkit
Class ComponentConfigUtil

java.lang.Object
  |
  +--org.realityforge.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.4 $ $Date: 2003/10/06 04:46:58 $
Author:
Peter Donald

Constructor Summary
ComponentConfigUtil()
           
 
Method Summary
static ConfigValidator getComponentConfigValidator(String classname, ClassLoader classLoader, String location, String type)
          Return the ConfigValidator for specified component.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ComponentConfigUtil

public ComponentConfigUtil()
Method Detail

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 component
classLoader - the classloader component loaded from
location - the location of schema
type - the type of schema
Returns:
the ConfigValidator
Throws:
Exception - if error creating validator


Copyright © 2003 The Spice Group. All Rights Reserved.