All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class com.ibm.eNetwork.beans.HOD.MacroPrompts

java.lang.Object
   |
   +----com.ibm.eNetwork.beans.HOD.MacroPrompts

public class MacroPrompts
extends Object
implements ECLConstants
MacroPrompts class contains functionality for iterating through and setting prompt values fired in a MacroPromptEvent.

When the macro runs it will be scanned for all prompt lines. Each new prompt identifier will be loaded into an object of the MacroPrompts class. This object will then be fired in a MacroPromptEvent, whereby a listener should set all values in the MacroPrompts object. After the object is set, the listener should call setPrompts on Macro to play the macro after prescan. If a value was not set, and there is a value specified on the prompt line, that value will be used. If there is no value on the prompt line, another event will be fired to try to retrieve the prompt data. If still no data is returned, the macro will end in an error.

See Also:
MacroPromptEvent, Macro

Constructor Index

 o MacroPrompts(Macro)
Constructs an instance of a prompt collection object.

Method Index

 o add(int, MacroActionPrompt)
Inserts the macro prompt action at the given index.
 o add(MacroActionPrompt)
Appends the macro prompt action to the end of the collection.
 o clear()
Removes all macro prompt actions from the collection
 o clearPromptValues()
Removes all prompt values
 o contains(MacroActionPrompt)
Tests to see if given macro prompt action is in the collection.
 o get(int)
Returns the macro prompt action at the given index
 o getNumPrompts()
Returns the number of prompts in the MacroPrompts object. Deprecated.
 o getPromptDefault(String)
Gets the default value of a prompt using a prompt name.
 o getPromptName(int)
Gets the name of a prompt at a given index.
 o getPromptValue(String)
Gets the value of a prompt using a prompt name.
 o indexOf(MacroActionPrompt)
Returns the index of the given macro prompt action.
 o isEmpty()
Tests to see if the macro prompt action collection is empty.
 o isPromptPassword(String)
Returns whether a prompt is a password display using a prompt name.
 o remove(int)
Removes the macro prompt action at the given index from the collection.
 o remove(MacroActionPrompt)
Removes the given macro prompt action from the collection.
 o set(MacroActionPrompt, int)
Replaces the macro prompt action object at the given index in the collection.
 o setPromptValue(String, String)
Sets the value of a prompt using a prompt name.
 o size()
Returns the number of actions in the macro prompt action collection.

Constructors

 o MacroPrompts
 public MacroPrompts(Macro mac)
Constructs an instance of a prompt collection object.

Parameters:
mac - Macro object that owns the prompts

Methods

 o get
 public MacroActionPrompt get(int argIndex)
Returns the macro prompt action at the given index

Parameters:
argIndex - index for the MacroAction object
Returns:
MacroActionPrompt object at the given index
 o set
 public void set(MacroActionPrompt argMA,
                 int argIndex)
Replaces the macro prompt action object at the given index in the collection.

Parameters:
argMA - MacroActionPrompt object to place in collection
argIndex - index for the MacroActionPrompt object
 o add
 public void add(MacroActionPrompt argMA)
Appends the macro prompt action to the end of the collection. If a prompt is already in the collection with the same name, the existing prompt will be removed and the new one will be saved.

Parameters:
argMA - MacroActionPrompt object to place in collection
 o add
 public void add(int argIndex,
                 MacroActionPrompt argMA)
Inserts the macro prompt action at the given index. All succeeding macro prompt actions will be shifted down in the collection. If a prompt is already in the collection with the same name, the existing prompt will be removed and the new one will be saved.

Parameters:
argMA - MacroActionPrompt object to place in collection
argIndex - index for the MacroActionPrompt object
 o contains
 public boolean contains(MacroActionPrompt argMA)
Tests to see if given macro prompt action is in the collection.

Parameters:
argMA - MacroActionPrompt object to place in collection
Returns:
true if MacroActionPrompt object is in the collection, false otherwise
 o isEmpty
 public boolean isEmpty()
Tests to see if the macro prompt action collection is empty.

Returns:
true if collection is empty, false otherwise
 o size
 public int size()
Returns the number of actions in the macro prompt action collection.

Returns:
number of actions in the collection
 o clear
 public void clear()
Removes all macro prompt actions from the collection

 o remove
 public void remove(MacroActionPrompt argMA)
Removes the given macro prompt action from the collection.

Parameters:
argMA - MacroActionPrompt object to remove from the collection
 o remove
 public void remove(int argIndex)
Removes the macro prompt action at the given index from the collection.

Parameters:
argIndex - index for the MacroActionPrompt object to remove
 o indexOf
 public int indexOf(MacroActionPrompt argMA)
Returns the index of the given macro prompt action.

Parameters:
argMA - MacroActionPrompt object to find index of
Returns:
index of the MacroActionPrompt object, -1 if object is not in collection
 o getPromptName
 public String getPromptName(int i)
Gets the name of a prompt at a given index.

Parameters:
i - Index for name
Returns:
String Name of the prompt if valid index, null if invalid index.
 o getPromptDefault
 public String getPromptDefault(String name)
Gets the default value of a prompt using a prompt name. When Macro populates the MacroPrompts object by scanning the macro at runtime, the first default value is used if there are multiple instances of prompts with the same name.

Parameters:
name - Name of the prompt
Returns:
String Prompt default value. Returns null if no name matches.
 o getPromptValue
 public String getPromptValue(String name)
Gets the value of a prompt using a prompt name. This is the value that was set using the setPrompts method on Macro after receiving a MacroPromptEvent.

Parameters:
name - Name of the prompt
Returns:
String Prompt value. Returns null if no name matches.
 o setPromptValue
 public void setPromptValue(String name,
                            String value)
Sets the value of a prompt using a prompt name.

Parameters:
name - Name of the prompt
value - Value of the prompt to set
 o isPromptPassword
 public boolean isPromptPassword(String name)
Returns whether a prompt is a password display using a prompt name.

Parameters:
name - Name of the prompt
Returns:
boolean true if prompt should be displayed as password, false otherwise.
 o clearPromptValues
 public void clearPromptValues()
Removes all prompt values

 o getNumPrompts
 public int getNumPrompts()
Note: getNumPrompts() is deprecated.

Returns the number of prompts in the MacroPrompts object.


All Packages  Class Hierarchy  This Package  Previous  Next  Index