Class ComparatorValidator

java.lang.Object
org.openxava.validators.ComparatorValidator
All Implemented Interfaces:
Serializable, IValidator

public class ComparatorValidator extends Object implements IValidator
Assert that a comparation is true.

Author:
Javier Paniza
See Also:
  • Constructor Details

    • ComparatorValidator

      public ComparatorValidator()
  • Method Details

    • validate

      public void validate(Messages errors) throws Exception
      Description copied from interface: IValidator
      Does validation.

      Specified by:
      validate in interface IValidator
      Parameters:
      errors - Validation errors list; a list of id to read in the resources file
      Throws:
      Exception - Any unexpected problem
    • getOperator

      public String getOperator()
      Operator used for comparing.

      Values allowed are EQ, NE, GT, LT, GE, LE, =, ==, !=, >, <, >=, <=.
      Default value is =.

    • setOperator

      public void setOperator(String operator)
      Operator used for comparing.

      Values allowed are EQ, NE, GT, LT, GE, LE, =, ==, !=, >, <, >=, <=.
      Default value is =.

    • getValue1

      public Comparable getValue1()
      First value to compare.

    • setValue1

      public void setValue1(Comparable value1)
      First value to compare.

    • getValue2

      public Comparable getValue2()
      Second value to compare.

    • setValue2

      public void setValue2(Comparable value2)
      Second value to compare.

    • getName1

      public String getName1()
      Name (used for retrieve label from i18n files) for first value.
    • setName1

      public void setName1(String name1)
      Name (used for retrieve label from i18n files) for first value.
    • getName2

      public String getName2()
      Name (used for retrieve label from i18n files) for second value.
    • setName2

      public void setName2(String name2)
      Name (used for retrieve label from i18n files) for second value.