public List<ValidationErrorMessage> validate(){
  errorMessageIds.clear();
  if (paymentProduct == null) {
    throw new NullPointerException("Error validating PaymentRequest, please set a paymentProduct first.");
  }
  for (  PaymentProductField field : paymentProduct.getPaymentProductFields()) {
    if (!isFieldInAccountOnFileAndNotAltered(field)) {
      errorMessageIds.addAll(field.validateValue(getValue(field.getId())));
    }
  }
  return errorMessageIds;
}

public List < ValidationErrorMessage > validate ( ) { errorMessageIds . clear ( ) ; if ( paymentProduct == null ) { throw new NullPointerException ( "Error validating PaymentRequest, please set a paymentProduct first." ) ; } for ( PaymentProductField field : paymentProduct . getPaymentProductFields ( ) ) { if ( ! isFieldInAccountOnFileAndNotAltered ( field ) ) { errorMessageIds . addAll ( field . validateValue ( getValue ( field . getId ( ) ) ) ) ; } } return errorMessageIds ; }
validates all fields based on their value and their validationrules if a field is prefilled from the account on file , but it has been altered , it will be validated .
