for (int i = 0; i < inviteeListFlexTable.getRowCount(); i++) {
Widget inviteeEmailIdTextBox = inviteeListFlexTable.getWidget(i, 0);
if (inviteeEmailIdTextBox instanceof TextBox
&& isValidEmail(((TextBox) inviteeEmailIdTextBox).getText().trim())) {
try {
Invitation invitation = new Invitation();
invitation.setEmailId(((TextBox) inviteeEmailIdTextBox).getText().trim());
Widget readerRButton = inviteeListFlexTable.getWidget(i, 1);
Widget writerRButton = inviteeListFlexTable.getWidget(i, 2);
if (readerRButton instanceof RadioButton && writerRButton instanceof RadioButton) {
invitation.setWriter(((RadioButton) writerRButton).getValue());
invitations.add(invitation);
}
} catch (Exception e) {
GWT.log("Exception in reading invitation list", e);
}