de.lehmannet.om.util
Class ConfigLoader

java.lang.Object
  extended by de.lehmannet.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
Author:
doergn@users.sourceforge.net

Constructor Summary
ConfigLoader()
           
 
Method Summary
static java.lang.String getFindingClassnameFromType(java.lang.String type)
          Returns the java classname for a finding that matches the given xsi:type attribute, which can be found at additional schema elements
E.g.
static java.lang.String getTargetClassnameFromType(java.lang.String type)
          Returns the java classname for a target 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

getTargetClassnameFromType

public static java.lang.String getTargetClassnameFromType(java.lang.String type)
                                                   throws ConfigException
Returns the java classname for a target 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: "de.lehmannet.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 (can be a finding xsi:type or an target xsi_type)
Returns:
The corresponding target java classname for the given type, or null if the type could not be resolved.
Throws:
ConfigException - if problems occured during load of config

getFindingClassnameFromType

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

If for example the type "fgca:findingsDeepSky" would be passed to this method, it would return the classname: "de.lehmannet.om.extension.deepSky.DeepSkyFinding". 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 (can be a finding xsi:type or an target xsi_type)
Returns:
The corresponding finding 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