live.struts.forms
Class Validations

java.lang.Object
  extended bylive.struts.forms.Validations

public class Validations
extends Object

Handles validations for all LIVE

Author:
Evan Driscoll

Field Summary
protected static boolean ALLOW_UNGROUPED
           
protected static boolean DISALLOW_UNGROUPED
           
 
Constructor Summary
Validations()
           
 
Method Summary
protected static void validateGroupName(LiveForm form, String groupName, boolean allowUngrouped)
          Validates a group name, generates an error if the group name is not correct
protected static void validateGuestName(LiveForm form, String guestName)
          Validates a guest name, adds an error if it is incorrect
protected static void validateInt(LiveForm form, String parameter, String key)
          Validates a string to make sure it can become an int
protected static void validateMemory(LiveForm form, String memory, String defOrMax)
          Validates a memory value and adds an error if it is incorrect.
protected static void validateNetworkName(LiveForm form, String netName)
          Validates a network name, adds an error if it is incorrect
protected static void validateNetworkPort(LiveForm form, String portName)
          Validates a network's port, adds an error if it is incorrect
protected static void validateNetworkRAddr(LiveForm form, String addr)
          Validates a network's real device address, adds an error if it is incorrect
protected static void validatePassword(LiveForm form, String password)
          Validates a password, adds an error if it is incorrect
protected static void validatePasswordMatch(LiveForm form, String password, String confirmation)
          Ensures that the password and confirmation password match
protected static void validateSegmentName(LiveForm form, String segName)
          Validates a saved segment name, adds an error if it is incorrect
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ALLOW_UNGROUPED

protected static final boolean ALLOW_UNGROUPED
See Also:
Constant Field Values

DISALLOW_UNGROUPED

protected static final boolean DISALLOW_UNGROUPED
See Also:
Constant Field Values
Constructor Detail

Validations

public Validations()
Method Detail

validateGroupName

protected static void validateGroupName(LiveForm form,
                                        String groupName,
                                        boolean allowUngrouped)
Validates a group name, generates an error if the group name is not correct

Parameters:
form - The form you are using
groupName - Group name to validate
allowUngrouped - Whether (ungrouped) is a valid groupname

validateMemory

protected static void validateMemory(LiveForm form,
                                     String memory,
                                     String defOrMax)
Validates a memory value and adds an error if it is incorrect.

Parameters:
form - Form you are using
memory - Memory value to check
defOrMax - Whether the memory value is for default or maximum memory

validateGuestName

protected static void validateGuestName(LiveForm form,
                                        String guestName)
Validates a guest name, adds an error if it is incorrect

Parameters:
form - Form you are using
guestName - Guest name to validate

validatePassword

protected static void validatePassword(LiveForm form,
                                       String password)
Validates a password, adds an error if it is incorrect

Parameters:
form - Form you are using
password - Passwor to validate

validatePasswordMatch

protected static void validatePasswordMatch(LiveForm form,
                                            String password,
                                            String confirmation)
Ensures that the password and confirmation password match

Parameters:
form - Form you are using
password - Original password
confirmation - Confirmation password

validateInt

protected static void validateInt(LiveForm form,
                                  String parameter,
                                  String key)
Validates a string to make sure it can become an int

Parameters:
form - Form you are using
parameter - String that you want to convert to an int
key - Description of parameter, for error creation

validateSegmentName

protected static void validateSegmentName(LiveForm form,
                                          String segName)
Validates a saved segment name, adds an error if it is incorrect

Parameters:
form - The form you are using
segName - The name of the segment you wish to validate

validateNetworkName

protected static void validateNetworkName(LiveForm form,
                                          String netName)
Validates a network name, adds an error if it is incorrect

Parameters:
form - The form you are using
netName - The name of the network you wish to validate

validateNetworkPort

protected static void validateNetworkPort(LiveForm form,
                                          String portName)
Validates a network's port, adds an error if it is incorrect

Parameters:
form - The form you are using
portName - The portname you wish to validate

validateNetworkRAddr

protected static void validateNetworkRAddr(LiveForm form,
                                           String addr)
Validates a network's real device address, adds an error if it is incorrect

Parameters:
form - The form you are using
addr - The real device address you wish to validate


Copyright © 2005