org.objectweb.jonas.newbean.Parameter Class Reference

List of all members.

Public Member Functions

 Parameter (VelocityContext context)
void walkThrough ()
void obtainValue ()
void setValue (String input)
abstract String getPrompt ()
abstract boolean isValid ()
abstract void export ()
abstract Parameter getNextParameter ()
abstract String getArgKeyword ()

Protected Attributes

VelocityContext vContext = null
String value = null

Detailed Description

This class represents a parameter the user may be prompted for. It is responsible for asking the user for a value, validating his input, exporting relevant datas into Velocity's context, and deciding what should be the next parameter to ask.

A parameter is created by subclassing this class and overriding the following abstract methods:

Definition at line 56 of file Parameter.java.


Constructor & Destructor Documentation

org.objectweb.jonas.newbean.Parameter.Parameter VelocityContext  context  ) 
 

Creates a new parameter that will export its variables into the specified Velocity context.

Parameters:
context the Velocity context into which variables will be exported

Definition at line 82 of file Parameter.java.


Member Function Documentation

abstract void org.objectweb.jonas.newbean.Parameter.export  )  [pure virtual]
 

Exports the variables managed by this parameter into the associated Velocity context (ie vContext).

abstract String org.objectweb.jonas.newbean.Parameter.getArgKeyword  )  [pure virtual]
 

Returns:
the command line keyword string for this parameter

abstract Parameter org.objectweb.jonas.newbean.Parameter.getNextParameter  )  [pure virtual]
 

Returns the parameter the user will be asked for after this one. This method is not invoked before a valid value has been entered for this parameter; therefor it is possible to decide which object to return based on the value of value.

This method returns null if their is no more parameters.

Returns:
the next parameter the user should be prompted for

abstract String org.objectweb.jonas.newbean.Parameter.getPrompt  )  [pure virtual]
 

Returns the string used to prompt the user for a value.

Returns:
the string used to prompt the user for a value.

abstract boolean org.objectweb.jonas.newbean.Parameter.isValid  )  [pure virtual]
 

Indicates whether this parameter as a valid value. This method can safely assume value is not null.

Returns:
true if value is valid, false otherwise

void org.objectweb.jonas.newbean.Parameter.obtainValue  ) 
 

Obtains the value of this parameter. This method prompts the user for a value, stores it into value through the isValid(). This process is repeated until the value is valid.

Definition at line 112 of file Parameter.java.

void org.objectweb.jonas.newbean.Parameter.setValue String  input  ) 
 

Sets the value of this parameter. This method is called each time a value is entered is entered by the user, before its validity has been checked.

This implementation simply sets value to input. You can override this method if you need to format this input, for example to convert it to uppercase.

Definition at line 151 of file Parameter.java.

void org.objectweb.jonas.newbean.Parameter.walkThrough  ) 
 

Recusively walk through the parameters graph, obtaining parameter (obtainValue()) values and exporting (export()) them.

The path taken through the parameter graph may change depending on the values entered by the user. It is determined after each valid input by a call to getNextParameter().

Definition at line 96 of file Parameter.java.

Referenced by org.objectweb.jonas.newbean.ParameterSet.walkThrough().


Member Data Documentation

String org.objectweb.jonas.newbean.Parameter.value = null [protected]
 

This parameter's value, as entered by the user.

Definition at line 72 of file Parameter.java.

VelocityContext org.objectweb.jonas.newbean.Parameter.vContext = null [protected]
 

The Velocity context into which this parameter's variables will be exported.

Definition at line 67 of file Parameter.java.


The documentation for this class was generated from the following file:
Generated on Tue Feb 15 15:07:17 2005 for JOnAS by  doxygen 1.3.9.1