org.marketcetera.util.auth
Class CliSetter<T extends Holder<?>>

java.lang.Object
  extended by org.marketcetera.util.auth.Setter<T>
      extended by org.marketcetera.util.auth.CliSetter<T>
Direct Known Subclasses:
CliSetterCharArray, CliSetterString

public abstract class CliSetter<T extends Holder<?>>
extends Setter<T>

A setter that obtains holder data via a command-line. It is supported by a CliContext.

Since:
0.5.0
Version:
$Id: CliSetter.java 16154 2012-07-14 16:34:05Z colin $
Author:
tlerios@marketcetera.com

Constructor Summary
CliSetter(T holder, I18NBoundMessage usage, String shortForm, String longForm, I18NBoundMessage description)
          Constructor mirroring superclass constructor.
 
Method Summary
 void addOption(Options options)
          Adds the receiver command-line option to the given options.
 I18NBoundMessage getDescription()
          Returns the description of the receiver's command-line option.
 String getLongForm()
          Returns the long form of the receiver's command-line option.
 String getShortForm()
          Returns the short form of the receiver's command-line option.
abstract  void setValue(CommandLine commandLine)
          Sets the holder's data by obtaining it from the given parsed command-line.
 
Methods inherited from class org.marketcetera.util.auth.Setter
getHolder, getUsage
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CliSetter

public CliSetter(T holder,
                 I18NBoundMessage usage,
                 String shortForm,
                 String longForm,
                 I18NBoundMessage description)
Constructor mirroring superclass constructor. The command-line option whose value is assigned to the holder data has the given short and long forms and description.

Parameters:
shortForm - The short form.
longForm - The long form.
description - The description.
See Also:
Setter.Setter(Holder,I18NBoundMessage)
Method Detail

getShortForm

public String getShortForm()
Returns the short form of the receiver's command-line option.

Returns:
The short form.

getLongForm

public String getLongForm()
Returns the long form of the receiver's command-line option.

Returns:
The long form.

getDescription

public I18NBoundMessage getDescription()
Returns the description of the receiver's command-line option.

Returns:
The description.

addOption

public void addOption(Options options)
Adds the receiver command-line option to the given options. This method is called by a CliContext.

Parameters:
options - The command-line options.

setValue

public abstract void setValue(CommandLine commandLine)
Sets the holder's data by obtaining it from the given parsed command-line. This method is called by a CliContext.

Parameters:
commandLine - The command-line.


Copyright © 2012. All Rights Reserved.