@ParametersAreNonnullByDefault public class TerminologyEntryValidator extends Object
Constructor and Description |
---|
TerminologyEntryValidator(TerminologyEntryDao terminologyEntryDao) |
Modifier and Type | Method and Description |
---|---|
TerminologyEntryWriter.TerminologyValidationResult |
validateNewTerminologyEntries(Collection<TerminologyEntry> terminologyEntries)
Validate if the
newName and newNamePlural is valid and originalName is allowed for new TerminologyEntry . |
public TerminologyEntryValidator(TerminologyEntryDao terminologyEntryDao)
public TerminologyEntryWriter.TerminologyValidationResult validateNewTerminologyEntries(Collection<TerminologyEntry> terminologyEntries)
newName
and newNamePlural
is valid and originalName
is allowed for new TerminologyEntry
.
Provided names are changed to lowercase and trimmed from whitespaces.
newName
and newNamePlural
can only be composed of letters, numbers and whitespaces.
newName
and newNamePlural
are not valid when they are:
TerminologyEntry
as new name,
Operator.values()
.
TerminologyEntry.getOriginalName()
listed in ValidatedTerminologyEntryImpl.AllowedOriginalName
,
Allowed values for originalName
are specified by the ValidatedTerminologyEntryImpl.AllowedOriginalName
.
TerminologyEntry
if validation passed. Otherwise a result with error collection.
Errors have fields set to affected name, one of "originalName", "newName" or "newNamePlural".
Their message indicates what is the issue. The reason for all of them is set to
ErrorCollection.Reason.VALIDATION_FAILED
.Copyright © 2002-2022 Atlassian. All Rights Reserved.