org.eodisp.util.configuration
Class BasicCommandlineMapper

java.lang.Object
  extended by org.eodisp.util.configuration.BasicCommandlineMapper
All Implemented Interfaces:
CommandlineMapper

 class BasicCommandlineMapper
extends java.lang.Object
implements CommandlineMapper

A basic implementation of the mapper interface. Maps configuration entries of type boolean to Switch, others to FlaggedOption instances. The id of the JSAP parameter is set to the following string: ConfigurationId.ConfigurationEntryId. The long flag is the key of the configuration entry (Configuration.Entry.getKey()) and the help is set from the configuration's description (Configuration.Entry.getDescription()).

Version:
$Id: BasicCommandlineMapper.java 3017 2006-08-11 22:23:22Z ibirrer $
Author:
ibirrer

Field Summary
(package private) static CommandlineMapper INSTANCE
           
 
Fields inherited from interface org.eodisp.util.configuration.CommandlineMapper
BASIC_COMMAND_LINE_MAPPER, NULL_COMMAND_LINE_MAPPER
 
Constructor Summary
BasicCommandlineMapper()
           
 
Method Summary
 com.martiansoftware.jsap.Parameter mapEntry(Configuration.Entry entry)
          Returns the JSAP parameter (command line option) that is mapped to the given entry.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

INSTANCE

static CommandlineMapper INSTANCE
Constructor Detail

BasicCommandlineMapper

BasicCommandlineMapper()
Method Detail

mapEntry

public com.martiansoftware.jsap.Parameter mapEntry(Configuration.Entry entry)
Description copied from interface: CommandlineMapper
Returns the JSAP parameter (command line option) that is mapped to the given entry. A return value of null means that no command line option shall be created for the given entry.

Specified by:
mapEntry in interface CommandlineMapper
Parameters:
entry - the entry that shall be mapped to a parameter
Returns:
the parameter mapped to the given configuration entry or null if the given configuration entry shall not be mapped to a command line option.