Class MultiTaskInvoker


  • public class MultiTaskInvoker
    extends java.lang.Object
    Invokes tasks from a command line when the tasks are available from an ObjectFactory.
    Since:
    23 Jan 2007
    Author:
    Mark Taylor
    • Constructor Summary

      Constructors 
      Constructor Description
      MultiTaskInvoker​(java.lang.String toolName, uk.ac.starlink.util.ObjectFactory<Task> taskFactory)
      Constructor.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String getVersionMessage()
      Returns the message to be reported if the "-version" flag is given.
      int invoke​(java.lang.String[] args)
      Invokes one of the tasks known by this invoker given a command line.
      void setVersionMessage​(java.lang.String msg)
      Sets the message which will be reported if the "-version" flag is given.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • MultiTaskInvoker

        public MultiTaskInvoker​(java.lang.String toolName,
                                uk.ac.starlink.util.ObjectFactory<Task> taskFactory)
        Constructor.
        Parameters:
        toolName - user-known name for the tool
        taskFactory - lists available tasks
    • Method Detail

      • invoke

        public int invoke​(java.lang.String[] args)
        Invokes one of the tasks known by this invoker given a command line. The commmand line is an array of words of the form
            [<flags>] <taskname> [<task-args>]
         
        Parameters:
        args - command line words
      • setVersionMessage

        public void setVersionMessage​(java.lang.String msg)
        Sets the message which will be reported if the "-version" flag is given.
        Parameters:
        msg - formatted version message
      • getVersionMessage

        public java.lang.String getVersionMessage()
        Returns the message to be reported if the "-version" flag is given.
        Returns:
        formatted version message