org.geotools.validation.spatial
Class IsValidGeometryValidation

java.lang.Object
  extended byorg.geotools.validation.DefaultFeatureValidation
      extended byorg.geotools.validation.spatial.IsValidGeometryValidation
All Implemented Interfaces:
FeatureValidation, Validation

public class IsValidGeometryValidation
extends DefaultFeatureValidation

Tests to see if a geometry is valid by calling Geometry.isValid().

The geometry is first tested to see if it is null, and if it is null, then it is tested to see if it is allowed to be null by calling isNillable().

Version:
$Id: IsValidGeometryValidation.java 17704 2006-01-23 00:26:16Z desruisseaux $
Author:
bowens, Refractions Research, Inc., $Author: dmzwiers $ (last modification)

Field Summary
 
Fields inherited from interface org.geotools.validation.Validation
ALL, PRIORITY_COMPLEX, PRIORITY_INVOLVED, PRIORITY_SIMPLE, PRIORITY_TRIVIAL
 
Constructor Summary
IsValidGeometryValidation()
          IsValidGeometryFeatureValidation constructor.
 
Method Summary
 int getPriority()
          Override getPriority.
 java.lang.String[] getTypeNames()
          Override getTypeNames.
 boolean validate(Feature feature, FeatureType type, ValidationResults results)
          Tests to see if a geometry is valid by calling Geometry.isValid().
 
Methods inherited from class org.geotools.validation.DefaultFeatureValidation
getDefaultLineString, getDescription, getName, getTypeRef, getTypeRefs, setDescription, setName, setTypeRef
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IsValidGeometryValidation

public IsValidGeometryValidation()
IsValidGeometryFeatureValidation constructor.

Description

Method Detail

getPriority

public int getPriority()
Override getPriority.

Sets the priority level of this validation.

Specified by:
getPriority in interface Validation
Overrides:
getPriority in class DefaultFeatureValidation
Returns:
A made up priority for this validation.
See Also:
Validation.getPriority()

getTypeNames

public java.lang.String[] getTypeNames()
Override getTypeNames.

Returns the TypeNames of the FeatureTypes used in this particular validation.

Returns:
An array of TypeNames
See Also:
org.geotools.validation.Validation#getTypeNames()

validate

public boolean validate(Feature feature,
                        FeatureType type,
                        ValidationResults results)
Tests to see if a geometry is valid by calling Geometry.isValid().

The geometry is first tested to see if it is null, and if it is null, then it is tested to see if it is allowed to be null by calling isNillable().

Specified by:
validate in interface FeatureValidation
Overrides:
validate in class DefaultFeatureValidation
Parameters:
feature - The Feature to be validated
type - The FeatureTypeInfo of the feature
results - The storage for error messages.
Returns:
True if the feature is a valid geometry.
See Also:
org.geotools.validation.FeatureValidation#validate(org.geotools.feature.Feature, org.geotools.feature.FeatureTypeInfo, org.geotools.validation.ValidationResults)


Copyright © GeoTools. All Rights Reserved.