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.attributes;
18:
19: import java.util.Map;
20: import java.util.logging.Logger;
21:
22: import org.geotools.validation.DefaultIntegrityValidation;
23: import org.geotools.validation.ValidationResults;
24:
25: import com.vividsolutions.jts.geom.Envelope;
26:
27: /**
28: * Tests to that an attribute's value is unique across the entire FeatureType.
29: *
30: * <p>
31: * For a starting point you may want to look at UniqueFIDIntegrityValidation
32: * </p>
33: *
34: * @author Jody Garnett, Refractions Research, Inc.
35: * @author $Author: dmzwiers $ (last modification)
36: * @source $URL: http://svn.geotools.org/geotools/tags/2.4.1/modules/extension/validation/src/main/java/org/geotools/validation/attributes/UniquityValidation.java $
37: * @version $Id: UniquityValidation.java 27862 2007-11-12 19:51:19Z desruisseaux $
38: */
39: public class UniquityValidation extends DefaultIntegrityValidation {
40: /** The logger for the validation module. */
41: private static final Logger LOGGER = org.geotools.util.logging.Logging
42: .getLogger("org.geotools.validation");
43:
44: /** Attribute name to check for uniquity */
45: private String attributeName;
46:
47: /**
48: * No argument constructor, required by the Java Bean Specification.
49: */
50: public UniquityValidation() {
51: }
52:
53: /**
54: * The priority level used to schedule this Validation.
55: *
56: * @return PRORITY_SIMPLE
57: *
58: * @see org.geotools.validation.Validation#getPriority()
59: */
60: public int getPriority() {
61: return PRIORITY_SIMPLE;
62: }
63:
64: /**
65: * Check FeatureType for ...
66: *
67: * <p>
68: * Detailed description...
69: * </p>
70: *
71: * @param layers Map of FeatureSource by "dataStoreID:typeName"
72: * @param envelope The bounding box that encloses the unvalidated data
73: * @param results Used to coallate results information
74: *
75: * @return <code>true</code> if all the features pass this test.
76: *
77: * @throws Exception DOCUMENT ME!
78: */
79: public boolean validate(Map layers, Envelope envelope,
80: ValidationResults results) throws Exception {
81: return false;
82: }
83: }
|