org.jscience.ml.om.util
Class ConfigLoader

java.lang.Object
  extended by org.jscience.ml.om.util.ConfigLoader

public class ConfigLoader
extends java.lang.Object

The ConfigLoader is used to find config files inside the classpath (and the extension directory), and if config files are found, it can provide easy access to the config information.

Since:
1.0

Constructor Summary
ConfigLoader()
           
 
Method Summary
static java.lang.String getClassnameFromType(java.lang.String type)
          Returns the java classname that matches the given xsi:type attribute, which can be found at additional schema elements
E.g.
static void reloadConfig()
          Scans the java classpath again for valid configfile.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ConfigLoader

public ConfigLoader()
Method Detail

getClassnameFromType

public static java.lang.String getClassnameFromType(java.lang.String type)
                                             throws ConfigException
Returns the java classname that matches the given xsi:type attribute, which can be found at additional schema elements
E.g.:
xsi:type="fgca:deepSkyGX">
// More Target data goes here

If for example the type "fgca:deepSkyGX" would be passed to this method, it would return the classname: "org.jscience.ml.om.deepSky.DeepSkyTarget". The classname may then be used to load the corresponding java class via java reflection API for a given schema element.

Parameters:
type - The xsi:type value which can be found at additional schema elements
Returns:
The corresponding java classname for the given type, or null if the type could not be resolved.
Throws:
ConfigException - if problems occured during load of config

reloadConfig

public static void reloadConfig()
                         throws ConfigException
Scans the java classpath again for valid configfile.

Throws:
ConfigException - if problems occured during load of config