01: /*
02: * GeoTools - OpenSource mapping toolkit
03: * http://geotools.org
04: * (C) 2004-2006, Geotools Project Managment Committee (PMC)
05: * (C) 2004 TOPP - www.openplans.org
06: *
07: * This library is free software; you can redistribute it and/or
08: * modify it under the terms of the GNU Lesser General Public
09: * License as published by the Free Software Foundation; either
10: * version 2.1 of the License, or (at your option) any later version.
11: *
12: * This library is distributed in the hope that it will be useful,
13: * but WITHOUT ANY WARRANTY; without even the implied warranty of
14: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15: * Lesser General Public License for more details.
16: */
17: package org.geotools.validation;
18:
19: import org.geotools.feature.Feature;
20:
21: /**
22: * Collates results of validation operations.
23: *
24: * <p>
25: * Following the lead the excelent design work in the JUnit testing framework
26: * validation results are collected by a ValidationResults object. This
27: * interface for the ValidationResults object also allows it to collect
28: * warning information.
29: * </p>
30: *
31: * @author Jody Garnett, Refractions Research, Inc
32: * @source $URL: http://svn.geotools.org/geotools/tags/2.4.1/modules/extension/validation/src/main/java/org/geotools/validation/ValidationResults.java $
33: */
34: public interface ValidationResults {
35: /**
36: * Called to configure ValidationResults according to the provided
37: * FeatureValidation
38: *
39: * @param validation Provided FeatureValidation
40: */
41: public void setValidation(Validation validation);
42:
43: /**
44: * Returns a validation error on against the provided feature, An optional
45: * error message may be provided. The validating web feature server will:
46: *
47: * <ul>
48: * <li>
49: * Collate all errors for transaction result
50: * </li>
51: * <li>
52: * Log all errors
53: * </li>
54: * <li>
55: * Transaction may be canceled or have partial success depending on
56: * transaction request
57: * </li>
58: * </ul>
59: *
60: * Please note:<br>
61: * The FeatureResults object has been provided with a Validation object
62: * allowing it access to the user's name for the test, and the users
63: * decription of the test. Use the message information only to provide
64: * specific failure information.
65: *
66: * @param feature Feature found invalid
67: * @param message Optional error message. Use a non null message to provide
68: * specific failure information.
69: */
70: public void error(Feature feature, String message);
71:
72: /**
73: * Returns a validation warning against the provided feature. An optional
74: * warning message may be provided The validating web feature server
75: * will:
76: *
77: * <ul>
78: * <li>
79: * Collate all warnings for a comment in the transaction result
80: * </li>
81: * <li>
82: * Log all warnings
83: * </li>
84: * </ul>
85: *
86: * The FeatureResults object has been provided with a Validation object
87: * allowing it access to the user's name for the test, and the users
88: * decription of the test. Use the message information only to provide
89: * specific failure information.
90: *
91: * @param feature Feature found to be in error
92: * @param message Optional warning message. Use a non null message to
93: * provide specific warning information.
94: */
95: public void warning(Feature feature, String message);
96: }
|