uk.ac.starlink.mirage
Class MirageDriver

java.lang.Object
  extended byuk.ac.starlink.mirage.MirageDriver

public class MirageDriver
extends Object

Main application class for the StarTable Mirage front-end. The class named by MIRAGE_CLASS must be on the JVM's classpath in order for this to work. No Mirage components need to be available during compilation or distribution of this code however. This is desirable since Mirage is distributed under a more restrictive licence than the GPL.

See Also:
Mirage

Field Summary
static String MIRAGE_CLASS
          Name of the main Mirage application class.
static String MIRAGE_CLASSPATH_PROP
          Name of the property used to locate the MIRAGE_CLASS class.
 
Constructor Summary
MirageDriver()
           
 
Method Summary
static void invokeMirage(StarTable table, List margs)
          Invokes the Mirage application on a StarTable object.
static boolean isMirageAvailable()
          Indicates whether the Mirage application is available in this JVM.
static void main(String[] args)
          Invoke the Mirage application on a list of named StarTables.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MIRAGE_CLASS

public static final String MIRAGE_CLASS
Name of the main Mirage application class.

See Also:
Constant Field Values

MIRAGE_CLASSPATH_PROP

public static final String MIRAGE_CLASSPATH_PROP
Name of the property used to locate the MIRAGE_CLASS class.

See Also:
Constant Field Values
Constructor Detail

MirageDriver

public MirageDriver()
Method Detail

main

public static void main(String[] args)
                 throws IOException,
                        Exception
Invoke the Mirage application on a list of named StarTables. Using the -d flag this command can also be used to dump the mirage-formatted version of a given table to standard output.

Parameters:
args - flags and names of the StarTables to pass to Mirage
Throws:
IOException
Exception

isMirageAvailable

public static boolean isMirageAvailable()
Indicates whether the Mirage application is available in this JVM. Unless the relevant class is on the classpath, it won't be. The invokeMirage(uk.ac.starlink.table.StarTable, java.util.List) method will only work if this method returns true.

Returns:
true iff the class MIRAGE_CLASS does not exist on the path named by the property MIRAGE_CLASSPATH_PROP

invokeMirage

public static void invokeMirage(StarTable table,
                                List margs)
                         throws ClassNotFoundException,
                                Exception
Invokes the Mirage application on a StarTable object.

Parameters:
table - the StarTable to pass to Mirage
margs - a list of other arguments (Strings) to pass as arguments to Mirage
Throws:
ClassNotFoundException - if isMirageAvailable() returns false
Exception

Copyright © 2004 CLRC: Central Laboratory of the Research Councils. All rights reserved.