001: /*
002: * GeoTools - OpenSource mapping toolkit
003: * http://geotools.org
004: * (C) 2004-2006, Geotools Project Managment Committee (PMC)
005: * (C) 2004 TOPP - www.openplans.org
006: *
007: * This library is free software; you can redistribute it and/or
008: * modify it under the terms of the GNU Lesser General Public
009: * License as published by the Free Software Foundation; either
010: * version 2.1 of the License, or (at your option) any later version.
011: *
012: * This library is distributed in the hope that it will be useful,
013: * but WITHOUT ANY WARRANTY; without even the implied warranty of
014: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
015: * Lesser General Public License for more details.
016: */
017: package org.geotools.validation;
018:
019: import java.util.Map;
020: import java.util.logging.Logger;
021:
022: import com.vividsolutions.jts.geom.Envelope;
023:
024: /**
025: * Tests to see if a Feature ...
026: *
027: * <p>
028: * This class is ment to be copied as a starting point for implementing
029: * IntegrityValidation. Chances are you are not working against a single
030: * typeName when performing an integrity test.
031: * </p>
032: *
033: * @author Jody Garnett, Refractions Research, Inc.
034: * @author $Author: dmzwiers $ (last modification)
035: * @source $URL: http://svn.geotools.org/geotools/tags/2.4.1/modules/extension/validation/src/main/java/org/geotools/validation/DefaultIntegrityValidation.java $
036: * @version $Id: DefaultIntegrityValidation.java 27862 2007-11-12 19:51:19Z desruisseaux $
037: */
038: public class DefaultIntegrityValidation implements IntegrityValidation {
039: /** The logger for the validation module. */
040: private static final Logger LOGGER = org.geotools.util.logging.Logging
041: .getLogger("org.geotools.validation");
042:
043: /** User's Name of this integrity test. */
044: private String name;
045:
046: /** User's description of this integrity test. */
047: private String description;
048:
049: /**
050: * No argument constructor, required by the Java Bean Specification.
051: */
052: public DefaultIntegrityValidation() {
053: }
054:
055: /**
056: * Override setName.
057: *
058: * <p>
059: * Sets the name of this validation.
060: * </p>
061: *
062: * @param name The name of this validation.
063: *
064: * @see org.geotools.validation.Validation#setName(java.lang.String)
065: */
066: public final void setName(String name) {
067: this .name = name;
068: }
069:
070: /**
071: * Override getName.
072: *
073: * <p>
074: * Returns the name of this particular validation.
075: * </p>
076: *
077: * @return The name of this particular validation.
078: *
079: * @see org.geotools.validation.Validation#getName()
080: */
081: public final String getName() {
082: return name;
083: }
084:
085: /**
086: * Override setDescription.
087: *
088: * <p>
089: * Sets the description of this validation.
090: * </p>
091: *
092: * @param description The description of the validation.
093: *
094: * @see org.geotools.validation.Validation#setDescription(java.lang.String)
095: */
096: public final void setDescription(String description) {
097: this .description = description;
098: }
099:
100: /**
101: * Override getDescription.
102: *
103: * <p>
104: * Returns the description of this validation as a string.
105: * </p>
106: *
107: * @return The description of this validation.
108: *
109: * @see org.geotools.validation.Validation#getDescription()
110: */
111: public final String getDescription() {
112: return description;
113: }
114:
115: /**
116: * The priority level used to schedule this Validation.
117: *
118: * @return PRORITY_SIMPLE
119: *
120: * @see org.geotools.validation.Validation#getPriority()
121: */
122: public int getPriority() {
123: return PRIORITY_SIMPLE;
124: }
125:
126: /**
127: * Implementation of getTypeNames.
128: *
129: * @return Array of typeNames, or empty array for all, null for disabled
130: *
131: * @see org.geotools.validation.Validation#getTypeRefs()
132: */
133: public String[] getTypeRefs() {
134: return null; // disabled by default
135: }
136:
137: /**
138: * Check FeatureType for ...
139: *
140: * <p>
141: * Detailed description...
142: * </p>
143: *
144: * @param layers Map of FeatureSource by "dataStoreID:typeName"
145: * @param envelope The bounding box that encloses the unvalidated data
146: * @param results Used to coallate results information
147: *
148: * @return <code>true</code> if all the features pass this test.
149: *
150: * @throws Exception DOCUMENT ME!
151: */
152: public boolean validate(Map layers, Envelope envelope,
153: ValidationResults results) throws Exception {
154: results.warning(null, "Validation not yet implemented");
155:
156: return false;
157: }
158: }
|