|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object sk.uniba.euromath.config.EuromathConfig
public final class EuromathConfig
Ensures that the emConfig.xml
configuration file is properly
loaded. Before the initInstance()
, one of the
setPluginRoot
functions must be called to set the root of the
plugin.
Implementation note: Error messages must not be localized in order for them to display always correctly.
Constructor Summary | |
---|---|
EuromathConfig()
|
Method Summary | |
---|---|
static sk.uniba.euromath.config.bind.Config |
getConfig()
Returns in-memory representation of emConfig.xml
configuration file. |
static URL |
getConfigFile()
Returns URL, determining position of config file. |
static Locale |
getLocale()
Returns locale as configured in the config file. |
static sk.uniba.euromath.config.bind.NamespaceType |
getNamespace(String namespaceURI)
Returns the namespace definition for given namespace URI. |
static URLDir |
getPluginRoot()
Returns directory where the plugin is located. |
static URLDir |
getSchemaLoc()
Returns the schema directory location. |
static URLDir |
getStylesheetLoc()
Returns the stylesheet directory location. |
static File |
getUserConfigFile()
Returns user-specific config file, or null if the file
does not exist. |
static String |
getUserConfigFileName()
Returns user-specific config file, or null if user does
not have home directory. |
static void |
initInstance()
Loads the configuration file. |
static boolean |
isInitialized()
Checks whether the class has been initialized. |
static void |
setPluginRoot()
Sets root of plugin to current dir. |
static void |
setPluginRoot(URLDir url)
Sets root of plugin. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public EuromathConfig()
Method Detail |
---|
public static sk.uniba.euromath.config.bind.Config getConfig()
emConfig.xml
configuration file.
public static URL getConfigFile()
public static String getUserConfigFileName()
null
if user does
not have home directory.
public static File getUserConfigFile()
null
if the file
does not exist.
public static URLDir getPluginRoot()
public static URLDir getStylesheetLoc()
initInstance()
call.
public static URLDir getSchemaLoc()
initInstance()
call.
public static void initInstance() throws javax.xml.bind.JAXBException, IOException, URISyntaxException
javax.xml.bind.JAXBException
- if config file is not valid, well formed, etc.
IOException
- if I/O error occurs.
URISyntaxException
- if config file contains invalid URIs.public static sk.uniba.euromath.config.bind.NamespaceType getNamespace(String namespaceURI)
namespaceURI
- the namespace identifier
null
if such
namespace is not defined.public static void setPluginRoot(URLDir url)
initInstance()
,
to set other root than current directory.
url
- address to the root of plugin.public static void setPluginRoot()
public static boolean isInitialized()
true
if the config file is parsed and can be
accessed, false
if initInstance()
was not
yet called.public static Locale getLocale()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |