org.geotools.validation.attributes
Class RangeValidation

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

public class RangeValidation
extends DefaultFeatureValidation

RangeFeatureValidation validates that a number is within a given range.

RangeFeatureValidation is a quick and simple class the checks that the given number resides within a given range.

Capabilities:

Example Use:

 RangeFeatureValidation x = new RangeFeatureValidation();
 
 x.setMin(3);
 x.setMax(5);
 x.setName("id");
 
 boolean result = x.validate(feature, featureType, results);
 

Author:
rgould, Refractions Research, Inc., $Author: cholmesny $ (last modification)
Module:

Field Summary
 
Fields inherited from interface Validation
ALL, PRIORITY_COMPLEX, PRIORITY_INVOLVED, PRIORITY_SIMPLE, PRIORITY_TRIVIAL
 
Constructor Summary
RangeValidation()
          RangeFeatureValidation constructor.
 
Method Summary
 String getAttribute()
          XPATH expression used to locate attribute
 int getMax()
          getMax purpose.
 int getMin()
          getMin purpose.
 int getPriority()
          Override getPriority.
 void setAttribute(String xpath)
          XPATH expression used to locate attribute
 void setMax(int i)
          setMax purpose.
 void setMin(int i)
          setMin purpose.
 boolean validate(SimpleFeature feature, SimpleFeatureType type, ValidationResults results)
          Override validate.
 
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

RangeValidation

public RangeValidation()
RangeFeatureValidation constructor.

Description

Method Detail

validate

public boolean validate(SimpleFeature feature,
                        SimpleFeatureType type,
                        ValidationResults results)
Override validate.

Description ...

Specified by:
validate in interface FeatureValidation
Overrides:
validate in class DefaultFeatureValidation
Parameters:
feature -
type -
results -
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)

getPriority

public int getPriority()
Override getPriority.

Description ...

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

getMax

public int getMax()
getMax purpose.

Description ...


getMin

public int getMin()
getMin purpose.

Description ...


setMax

public void setMax(int i)
setMax purpose.

Description ...

Parameters:
i -

setMin

public void setMin(int i)
setMin purpose.

Description ...

Parameters:
i -

getAttribute

public String getAttribute()
XPATH expression used to locate attribute

Returns:
xpath

setAttribute

public void setAttribute(String xpath)
XPATH expression used to locate attribute

Parameters:
xpath -


Copyright © 1996-2009 Geotools. All Rights Reserved.