01: /*
02: * GeoTools - OpenSource mapping toolkit
03: * http://geotools.org
04: * (C) 2004-2006, Geotools Project Managment Committee (PMC)
05: *
06: * This library is free software; you can redistribute it and/or
07: * modify it under the terms of the GNU Lesser General Public
08: * License as published by the Free Software Foundation; either
09: * version 2.1 of the License, or (at your option) any later version.
10: *
11: * This library is distributed in the hope that it will be useful,
12: * but WITHOUT ANY WARRANTY; without even the implied warranty of
13: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14: * Lesser General Public License for more details.
15: *
16: * Created on 18-Jun-2004
17: */
18: package org.geotools.validation;
19:
20: import java.util.ArrayList;
21: import java.util.List;
22:
23: import org.geotools.feature.Feature;
24:
25: /**
26: * @source $URL: http://svn.geotools.org/geotools/tags/2.4.1/modules/extension/validation/src/main/java/org/geotools/validation/DefaultFeatureResults.java $
27: */
28: public final class DefaultFeatureResults implements ValidationResults {
29: Validation trial;
30: public List error = new ArrayList();
31: public List warning = new ArrayList();
32:
33: public void setValidation(Validation validation) {
34: trial = validation;
35: }
36:
37: public void error(Feature feature, String message) {
38: String where = feature != null ? feature.getID() : "all";
39: error.add(where + ":" + message);
40: System.err.println(where + ":" + message);
41: }
42:
43: public void warning(Feature feature, String message) {
44: String where = feature != null ? feature.getID() : "all";
45: warning.add(where + ":" + message);
46: System.out.println(where + ":" + message);
47: }
48: }
|