/* * Geotools2 - OpenSource mapping toolkit * http://geotools.org * (C) 2002, Geotools Project Managment Committee (PMC) * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; * version 2.1 of the License. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * */ /* Copyright (c) 2001, 2003 TOPP - www.openplans.org. All rights reserved. * This code is licensed under the GPL 2.0 license, availible at the root * application directory. */ package org.geotools.validation; import org.geotools.feature.Feature; import org.geotools.feature.FeatureType; /** * Defined a per Feature validation test. * *

* Each ValidationPlugIn is very specific in nature: it performs one test * extermly well. This simplifies design decisions, documenation * configuration and use. *

* *

* Following the lead the excelent design work in the JUnit testing framework * validation results are collected by a ValidationResults object. This * interface for the ValidationResults object also allows it to collect * warning information. *

* *

* The PlugIn is also required to supply some metadata to aid in its * deployment, scripting, logging and execution and error recovery: * *

*

* *

* Capabilities: * *

*

* *

* Example Use (feature: id=1, name="foo", geom=linestring): *


 * RangeFeatureValidation test = new RangeFeatureValidation();
 * 
 * results.setValidation( test );
 * test.setMin(0);
 * test.validate( feature, featureType, results ); // true
 * test.setMin(2);
 * test.validate( feature, featureType, results ); // false
 * 
*

* * @author Jody Garnett, Refractions Research, Inc. * @source $URL$ * @version $Id$ */ public interface FeatureValidation extends Validation { /** * Used to check features against this validation rule. * * @param feature Feature to be Validated * @param type FeatureTypeInfo schema of feature * @param results coallate results information * * @return True if feature passes this test. */ public boolean validate(Feature feature, FeatureType type, ValidationResults results) throws Exception; }