de.fhg.igd.util
Class WhatIs

java.lang.Object
  extended by de.fhg.igd.util.WhatIs

public class WhatIs
extends Object

A place to stash global definitions of paths and other parameters. This class is initialized by means of a file that adheres to the syntax defined in class Properties. Initialization is done via the public static void main(String[] argv) method.

Version:
"$Id: WhatIs.java 1913 2007-08-08 02:41:53Z jpeters $"
Author:
Volker Roth

Field Summary
static String OPT_DESCR
          The options descriptor.
private static Map whatis_
          The Map that stores the key to value mappings.
 
Constructor Summary
private WhatIs()
          No-one creates instances of this class.
 
Method Summary
protected static void init(Map defs)
          Initialize this class with a Map that contains all the mappings server by it.
static Set keySet()
          Returns the set of keys of the global static definitions.
static void main(String[] argv)
          The command line interface to initializing WhatIs.
static CanonicalPath pathValue(String key)
          Returns the CanonicalPath defined under the given key.
static String stringValue(String key)
          Returns the value of the given key in the global static definitions.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

OPT_DESCR

public static final String OPT_DESCR
The options descriptor.

See Also:
Constant Field Values

whatis_

private static Map whatis_
The Map that stores the key to value mappings.

Constructor Detail

WhatIs

private WhatIs()
No-one creates instances of this class.

Method Detail

init

protected static final void init(Map defs)
Initialize this class with a Map that contains all the mappings server by it. This method can be called only once with a valid Map instance. This method must be called before any other methods.

Parameters:
defs - The Map of definitions.

pathValue

public static final CanonicalPath pathValue(String key)
Returns the CanonicalPath defined under the given key. Access is public so do not put confidential information into the WhatIs list.

Parameters:
key - The key that identifies the desired path in the list of global static definitions.
Returns:
The CanonicalPaththat is defined under the given key.

stringValue

public static final String stringValue(String key)
Returns the value of the given key in the global static definitions. If the given key is not defined, this method returns null.

Parameters:
key - The key that identifies the desired value in the list of global static definitions.
Returns:
The string value of the given key in the global WhatIs list.
Throws:
NullPointerException - iff key is null.

keySet

public static final Set keySet()
Returns the set of keys of the global static definitions.

Returns:
The set of keys of the global WhatIs list.

main

public static void main(String[] argv)
The command line interface to initializing WhatIs. The following parameters are accepted:
-init <url>
The file URL to the definitions to be loaded into WhatIs. This can be done only once for each run of the VM.
-dump
Dumps the contents of WhatIs to the console.
-help
Prints a list of accepted parameters to the console.



Copyright © Fraunhofer Gesellschaft. All Rights Reserved.