public interface DataValidator
Modifier and Type | Method and Description |
---|---|
void |
validateEntry(Database database,
DatabaseEntry newData,
DatabaseEntry oldData)
This method can be used to either alter data before it is saved into the database or
to abort a particular operation by throwing an InvalidDataException.
|
void validateEntry(Database database, DatabaseEntry newData, DatabaseEntry oldData) throws InvalidDataException, IOException
This method is called under four circumstances.
database
- The Database that holds the data.newData
- The data being saved or changed or read. If you need to modify the data,
then modify this parameter.oldData
- The original data before the change or deletion.InvalidDataException
- If the operation should be disallowed due to bad data.IOException