project35.soa.validation
Class BoundedDoubleValidator
java.lang.Object
project35.soa.validation.AbstractEditFieldValidationService
project35.soa.validation.NumericValidator
project35.soa.validation.DoubleValidator
project35.soa.validation.BoundedDoubleValidator
- All Implemented Interfaces:
- java.io.Serializable, ServiceClass, ConstraintDescription, EditFieldValidationService, FieldValidationService
public class BoundedDoubleValidator
- extends DoubleValidator
- implements ConstraintDescription
Determines whether a double field value is within minimum and maximum bounds
boundaries are inclusive. The validator accepts four types of domain
expression. Examples include:
- [4.5,10.1] at least 4.5 and at most 10.1
- (4.5,10.1] more than 4.5 and up to and including 10.1
- [4.5,10.1) at least 4.5 and below 10.1
- (4.5,10.1) above 4.5 and below 10.1
Copyright (c) 2008 Kevin Garwood for Project35. The original code was
developed by Kevin Garwood for the University of Manchester. Revisions
have been made for Project35, a project that is independent of that
institution. This code is licensed under the Academic Free License
version 3.0. The code attribution for the original code is included here:
Copyright (c) Kevin Garwood and University of Manchester 2007.
All rights reserved. Licensed under the Academic Free License
version 3.0. For more information on the terms and conditions,
please see the file "LICENSE" that is included in this distribution.
- Version:
- 1.0
- Author:
- Kevin Garwood (kgarwood@users.sourceforge.net)
- See Also:
- Serialized Form
Method Summary |
java.lang.String |
getConstraintsDescription()
|
void |
setBounds(double lowerBound,
boolean lowerBoundIsInclusive,
double upperBound,
boolean upperBoundIsInclusive)
sets lower and upper bounds |
void |
setLowerBound(double lowerBound,
boolean lowerBoundIsInclusive)
sets lower bounds |
void |
setUpperBound(double upperBound,
boolean upperBoundIsInclusive)
|
java.util.ArrayList |
validate(Project35FormContext project35FormContext,
java.lang.String value)
validates a field value |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
BoundedDoubleValidator
public BoundedDoubleValidator()
getConstraintsDescription
public java.lang.String getConstraintsDescription()
- Specified by:
getConstraintsDescription
in interface ConstraintDescription
setBounds
public void setBounds(double lowerBound,
boolean lowerBoundIsInclusive,
double upperBound,
boolean upperBoundIsInclusive)
- sets lower and upper bounds
- Parameters:
lowerBound
- the lower bound valuelowerBoundIsInclusive
- whether lower bound is inclusive or exlusiveupperBound
- the upper bound valueupperBoundIsInclusive
- whether upper bound is inclusive or exlusive
setLowerBound
public void setLowerBound(double lowerBound,
boolean lowerBoundIsInclusive)
- sets lower bounds
- Parameters:
lowerBound
- the lower bound valuelowerBoundIsInclusive
- whether lower bound is inclusive or exlusive
setUpperBound
public void setUpperBound(double upperBound,
boolean upperBoundIsInclusive)
validate
public java.util.ArrayList validate(Project35FormContext project35FormContext,
java.lang.String value)
- validates a field value
- Specified by:
validate
in interface EditFieldValidationService
- Overrides:
validate
in class DoubleValidator
- Parameters:
project35FormContext
- contains references to various application
featuresvalue
- the field value
- Returns:
- error message or empty string null if no errors were found