01: /**
02: * Objective Database Abstraction Layer (ODAL)
03: * Copyright (c) 2004, The ODAL Development Group
04: * All rights reserved.
05: * For definition of the ODAL Development Group please refer to LICENCE.txt file
06: *
07: * Distributable under LGPL license.
08: * See terms of license at gnu.org.
09: */package com.completex.objective.components.persistency.rule;
10:
11: import com.completex.objective.components.persistency.PersistentEntry;
12:
13: /**
14: * Validates PersistentEntry
15: *
16: * @author Gennady Krizhevsky
17: */
18: public interface FieldValidator extends FieldRule {
19:
20: /**
21: * Validates PersistentEntry
22: *
23: * @param entry
24: * @return Error message if error happens or empty string otherwise.
25: * @throws Exception
26: */
27: String validate(PersistentEntry entry) throws Exception;
28:
29: /**
30: * Validates PersistentEntry
31: *
32: * @param entry
33: * @param verbose if true Exception is thrown when validation error encountered
34: * @return if <t>verbose</t> flag is <t>false</t> then error message if error happens or empty string otherwise.
35: * @throws Exception
36: */
37: String validate(PersistentEntry entry, boolean verbose)
38: throws Exception;
39:
40: }
|