org.geotools.validation.attributes
Class EqualityValidation

java.lang.Object
  extended byorg.geotools.validation.attributes.EqualityValidation
All Implemented Interfaces:
FeatureValidation, Validation

public class EqualityValidation
extends java.lang.Object
implements FeatureValidation

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.


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 getDescription()
          Override getDescription.
 java.lang.String getName()
          Access the user's name for this test.
 int getPriority()
          The priority level used to schedule this Validation.
 java.lang.String getTypeRef()
          Access typeRef property.
 java.lang.String[] getTypeRefs()
          Implementation of getTypeNames.
 void setDescription(java.lang.String description)
          Sets the description of this validation.
 void setName(java.lang.String name)
          Sets the name of this validation.
 void setTypeRef(java.lang.String typeRef)
          Set typeRef to typeName.
 boolean validate(org.geotools.feature.Feature feature, org.geotools.feature.FeatureType type, ValidationResults results)
          Validation test for feature.
 
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

setName

public void setName(java.lang.String name)
Sets the name of this validation.

Specified by:
setName in interface Validation
Parameters:
name - The name of this validation.
See Also:
Validation.setName(java.lang.String)

getName

public java.lang.String getName()
Access the user's name for this test.

Specified by:
getName in interface Validation
Returns:
The name of this validation.
See Also:
Validation.getName()

setDescription

public void setDescription(java.lang.String description)
Sets the description of this validation.

Specified by:
setDescription in interface Validation
Parameters:
description - The description of the validation.
See Also:
Validation.setDescription(java.lang.String)

getDescription

public java.lang.String getDescription()
Override getDescription.

Returns the description of this validation as a string.

Specified by:
getDescription in interface Validation
Returns:
The description of this validation.
See Also:
Validation.getDescription()

getPriority

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

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

getTypeRefs

public java.lang.String[] getTypeRefs()
Implementation of getTypeNames.

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

getTypeRef

public java.lang.String getTypeRef()
Access typeRef property.

Returns:
Returns the typeName.

setTypeRef

public void setTypeRef(java.lang.String typeRef)
Set typeRef to typeName.


validate

public boolean validate(org.geotools.feature.Feature feature,
                        org.geotools.feature.FeatureType type,
                        ValidationResults results)
Validation test for feature.

Description of test ...

Specified by:
validate in interface FeatureValidation
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)