Class AbstractValidation
- java.lang.Object
-
- org.dspace.app.rest.submit.step.validation.AbstractValidation
-
- All Implemented Interfaces:
Validation
- Direct Known Subclasses:
LicenseValidation,MetadataValidation,UploadValidation
public abstract class AbstractValidation extends Object implements Validation
Abstract class to provide basic management of errors resulting from a validation on a submission- Author:
- Luigi Andrea Pascarelli (luigiandrea.pascarelli at 4science.it)
-
-
Constructor Summary
Constructors Constructor Description AbstractValidation()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddError(String i18nKey, String path)Add an error message (i18nKey) for a specific json pathList<ErrorRest>getErrors()Expose the identified errorsStringgetName()An unique name to identify the validation implementationvoidsetName(String name)-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.dspace.app.rest.submit.step.validation.Validation
validate
-
-
-
-
Method Detail
-
getName
public String getName()
An unique name to identify the validation implementation- Specified by:
getNamein interfaceValidation
-
setName
public void setName(String name)
-
addError
public void addError(String i18nKey, String path)
Add an error message (i18nKey) for a specific json path- Parameters:
i18nKey- the validation error message as a key to internationalizepath- the json path that identify the wrong data in the submission. It could be as specific as a single value in a multivalued attribute or general of a "whole" section
-
-