org.geotools.validation.spatial
Class IsValidGeometryValidation

Object
  extended by DefaultFeatureValidation
      extended by 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().

Author:
bowens, Refractions Research, Inc., $Author: dmzwiers $ (last modification)
Module:
modules/extension/validation (gt-validation.jar)

Field Summary
 
Fields inherited from interface Validation
ALL, PRIORITY_COMPLEX, PRIORITY_INVOLVED, PRIORITY_SIMPLE, PRIORITY_TRIVIAL
 
Constructor Summary
IsValidGeometryValidation()
          IsValidGeometryFeatureValidation constructor.
 
Method Summary
 int getPriority()
          Override getPriority.
 String[] getTypeNames()
          Override getTypeNames.
 boolean validate(SimpleFeature feature, SimpleFeatureType type, ValidationResults results)
          Tests to see if a geometry is valid by calling Geometry.isValid().
 
Methods inherited from class DefaultFeatureValidation
getDefaultLineString, getDescription, getName, getTypeRef, getTypeRefs, setDescription, setName, setTypeRef
 
Methods inherited from class 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 String[] getTypeNames()
Override getTypeNames.

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

Returns:
An array of TypeNames
See Also:
Validation.getTypeRefs()

validate

public boolean validate(SimpleFeature feature,
                        SimpleFeatureType 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.FeatureType, org.geotools.validation.ValidationResults)


Copyright © 1996-2010 Geotools. All Rights Reserved.