org.geotools.validation
Interface FeatureValidation

All Superinterfaces:
Validation
All Known Implementing Classes:
AttributeValidation, DefaultFeatureValidation, DomainValidation, EqualityValidation, GazetteerNameValidation, IsValidGeometryValidation, LineMustBeASinglePartValidation, LineNoSelfIntersectValidation, LineNoSelfOverlappingValidation, NullZeroValidation, PolygonNoGapsValidation, RangeValidation, SingleValueValidation, SQLValidation

public interface FeatureValidation
extends Validation

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.
Module:

Field Summary
 
Fields inherited from interface Validation
ALL, PRIORITY_COMPLEX, PRIORITY_INVOLVED, PRIORITY_SIMPLE, PRIORITY_TRIVIAL
 
Method Summary
 boolean validate(SimpleFeature feature, SimpleFeatureType type, ValidationResults results)
          Used to check features against this validation rule.
 
Methods inherited from interface Validation
getDescription, getName, getPriority, getTypeRefs, setDescription, setName
 

Method Detail

validate

boolean validate(SimpleFeature feature,
                 SimpleFeatureType type,
                 ValidationResults results)
                 throws Exception
Used to check features against this validation rule.

Parameters:
feature - Feature to be Validated
type - FeatureTypeInfo schema of feature
results - coallate results information
Returns:
True if feature passes this test.
Throws:
Exception


Copyright © 1996-2009 Geotools. All Rights Reserved.