org.geotools.validation.attributes
Class EqualityValidation

Object
  extended by DefaultFeatureValidation
      extended by EqualityValidation
All Implemented Interfaces:
FeatureValidation, Validation

public class EqualityValidation
extends DefaultFeatureValidation

Tests to see if an attribute is equal to a provided value.

I can only see this test being useful if a Filter is also used. Online research shows that this test is used in the wild, so we are adding it into our system.

Author:
Jody Garnett, 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
EqualityValidation()
          No argument constructor, required by the Java Bean Specification.
 
Method Summary
 String getAttributeName()
          Access attributeName property.
 Object getExpected()
          Access expected property.
 Filter getFilter()
          Access filter property.
 int getPriority()
          The priority level used to schedule this Validation.
 String[] getTypeRefs()
          Implementation of getTypeNames.
 void setAttributeName(String attributeName)
          Set attributeName to attributeName.
 void setExpected(Object expected)
          Set expected to expected.
 void setFilter(Filter filter)
          Set filter to filter.
 boolean validate(SimpleFeature feature, SimpleFeatureType type, ValidationResults results)
          Validation test for feature.
 
Methods inherited from class DefaultFeatureValidation
getDefaultLineString, getDescription, getName, getTypeRef, setDescription, setName, setTypeRef
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EqualityValidation

public EqualityValidation()
No argument constructor, required by the Java Bean Specification.

Method Detail

getPriority

public int getPriority()
The priority level used to schedule this Validation.

Specified by:
getPriority in interface Validation
Overrides:
getPriority in class DefaultFeatureValidation
Returns:
PRORITY_SIMPLE
See Also:
Validation.getPriority()

getTypeRefs

public String[] getTypeRefs()
Implementation of getTypeNames.

Specified by:
getTypeRefs in interface Validation
Overrides:
getTypeRefs in class DefaultFeatureValidation
Returns:
Array of typeNames, or empty array for all, null for disabled
See Also:
Validation.getTypeRefs()

validate

public boolean validate(SimpleFeature feature,
                        SimpleFeatureType type,
                        ValidationResults results)
Validation test for feature.

Description of test ...

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

getAttributeName

public String getAttributeName()
Access attributeName property.

Returns:
Returns the attributeName.

setAttributeName

public void setAttributeName(String attributeName)
Set attributeName to attributeName.

Parameters:
attributeName - The attributeName to set.

getExpected

public Object getExpected()
Access expected property.

Returns:
Returns the expected.

setExpected

public void setExpected(Object expected)
Set expected to expected.

Parameters:
expected - The expected to set.

getFilter

public Filter getFilter()
Access filter property.

Returns:
Returns the filter.

setFilter

public void setFilter(Filter filter)
Set filter to filter.

Parameters:
filter - The filter to set.


Copyright © 1996-2010 Geotools. All Rights Reserved.