public void parseTextEntry(final String entryText) { String existingEntry = valueAdapter.asEncodedString(); valueAdapter.parseTextEntry(entryText); Consent valid = ((ValueAssociation) getField()).isValueValid(getParent(), valueAdapter); if (valid.isVetoed()) { valueAdapter.restoreFromEncodedString(existingEntry); throw new InvalidEntryException(valid.getReason()); } if (getValueAssociation().isMandatory() && valueAdapter.isEmpty()) { valueAdapter.restoreFromEncodedString(existingEntry); throw new InvalidEntryException("Mandatory field cannot be empty"); } }
markDamaged(); } catch (InvalidEntryException e) { invalidReason = "INVALID ENTRY: " + e.getMessage(); getFeedbackManager().setError(invalidReason); getState().setInvalid();