Validators
Class AccountValidator

java.lang.Object
  extended byValidators.AccountValidator

public class AccountValidator
extends java.lang.Object

Author:
student This class is being used for validating the account limits that a user has.

Field Summary
private  java.lang.String message
           
 
Constructor Summary
AccountValidator()
           
 
Method Summary
 java.lang.String getMessage()
          This method is being used for getting the error message to be displayed.
 void setMessage(java.lang.String message)
          This method is being used for setting the error message that is to be displayed.
 boolean validate(User_Data userdata)
          This method is being used for validating the given user's account account details.
 boolean validate(User_Data userdata, Stock_Data stockdata)
          This method is being used for validating the account and and the stock details of the given user.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

message

private java.lang.String message
Constructor Detail

AccountValidator

public AccountValidator()
Method Detail

getMessage

public java.lang.String getMessage()
This method is being used for getting the error message to be displayed.

Returns:
String The message to be displayed.

setMessage

public void setMessage(java.lang.String message)
This method is being used for setting the error message that is to be displayed.

Parameters:
message - The message to be displayed.
Returns:
void

validate

public boolean validate(User_Data userdata)
This method is being used for validating the given user's account account details.

Parameters:
userdata - The user whose account is to be validated.
Returns:
boolean Specifies whether the validation was successful.

validate

public boolean validate(User_Data userdata,
                        Stock_Data stockdata)
This method is being used for validating the account and and the stock details of the given user.

Parameters:
userdata - The user whose details are to be validated.
stockdata - The stock which is to be bought.
Returns:
boolean Specifies whether the validation was successful.