Decision Center API

ilog.rules.teamserver.web.validator
Class IlrComparablePropertyValidator

java.lang.Object
  extended by ilog.rules.teamserver.web.validator.IlrComparablePropertyValidator
All Implemented Interfaces:
IlrTypeValidator

public class IlrComparablePropertyValidator
extends Object
implements IlrTypeValidator

IlrComparablePropertyValidator compares the property it is attached to with a property specified with the validator-compared-property annotation.

Property comparison is achieved using the constraint specified with the validator-constraint annotation. A validator is attached to a property using an annotation in the extension model. The property type must implement java.lang.Comparable and must be an attribute, not a reference. The constraint must be choosen from the enum IlrComparablePropertyValidator.Constraint.


Nested Class Summary
static class IlrComparablePropertyValidator.Constraint
          The list of available constraints that can be used with IlrComparablePropertyValidator.
 
Constructor Summary
IlrComparablePropertyValidator()
           
 
Method Summary
 String getInvalidMessage()
          Gets the message that will be displayed in case convertAndValidate returns false.
 boolean validate(org.eclipse.emf.ecore.EStructuralFeature property, Object value, IlrCommitableObject co)
          This method validates a given value of a a given committable object, given its property.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IlrComparablePropertyValidator

public IlrComparablePropertyValidator()
Method Detail

validate

public boolean validate(org.eclipse.emf.ecore.EStructuralFeature property,
                        Object value,
                        IlrCommitableObject co)
Description copied from interface: IlrTypeValidator
This method validates a given value of a a given committable object, given its property.

The type of value corresponds to the type of property. For instance, if the property is of type int, the value is of type Integer. If the property is of type date, the value is of type Date.

Specified by:
validate in interface IlrTypeValidator
Returns:
true If the value is valid, and false otherwise.

getInvalidMessage

public String getInvalidMessage()
Description copied from interface: IlrTypeValidator
Gets the message that will be displayed in case convertAndValidate returns false.

Specified by:
getInvalidMessage in interface IlrTypeValidator
Returns:
The message.

Decision Center API

© Copyright IBM Corp. 1987, 2013