org.geotools.validation.attributes
Class EqualityValidation

java.lang.Object
  extended byorg.geotools.validation.DefaultFeatureValidation
      extended byorg.geotools.validation.attributes.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.

Version:
$Id: EqualityValidation.java 17704 2006-01-23 00:26:16Z desruisseaux $
Author:
Jody Garnett, 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
EqualityValidation()
          No argument constructor, required by the Java Bean Specification.
 
Method Summary
 java.lang.String getAttributeName()
          Access attributeName property.
 java.lang.Object getExpected()
          Access expected property.
 Filter getFilter()
          Access filter property.
 int getPriority()
          The priority level used to schedule this Validation.
 java.lang.String[] getTypeRefs()
          Implementation of getTypeNames.
 void setAttributeName(java.lang.String attributeName)
          Set attributeName to attributeName.
 void setExpected(java.lang.Object expected)
          Set expected to expected.
 void setFilter(Filter filter)
          Set filter to filter.
 boolean validate(Feature feature, FeatureType type, ValidationResults results)
          Validation test for feature.
 
Methods inherited from class org.geotools.validation.DefaultFeatureValidation
getDefaultLineString, getDescription, getName, getTypeRef, setDescription, setName, setTypeRef
 
Methods inherited from class java.lang.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 java.lang.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(Feature feature,
                        FeatureType 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.geotools.feature.Feature, org.geotools.feature.FeatureType, org.geotools.validation.ValidationResults)

getAttributeName

public java.lang.String getAttributeName()
Access attributeName property.

Returns:
Returns the attributeName.

setAttributeName

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

Parameters:
attributeName - The attributeName to set.

getExpected

public java.lang.Object getExpected()
Access expected property.

Returns:
Returns the expected.

setExpected

public void setExpected(java.lang.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 © GeoTools. All Rights Reserved.