Class PropertyValidationRule

java.lang.Object
rife.validation.AbstractValidationRule
rife.validation.PropertyValidationRule
All Implemented Interfaces:
Cloneable, ValidationRule
Direct Known Subclasses:
ValidationRuleEmail, ValidationRuleFormat, ValidationRuleInList, ValidationRuleLimitedDate, ValidationRuleLimitedLength, ValidationRuleNotEmpty, ValidationRuleNotEqual, ValidationRuleNotNull, ValidationRuleRange, ValidationRuleRegexp, ValidationRuleSameAs, ValidationRuleUrl

public abstract class PropertyValidationRule extends AbstractValidationRule
This abstract class extends the AbstractValidationRule class to provide common functionality that is useful for all bean property validation rules.
Since:
1.0
  • Constructor Details

    • PropertyValidationRule

      protected PropertyValidationRule(String propertyName)
      Instantiates a new PropertyValidationRule instance.
      Parameters:
      propertyName - the name of the property
      Since:
      1.0
  • Method Details

    • setPropertyName

      public <T extends PropertyValidationRule> T setPropertyName(String propertyName)
      Set the name of the property.
      Parameters:
      propertyName - the name of the property
      Since:
      1.0
      See Also:
    • getPropertyName

      public String getPropertyName()
      Retrieves the name of the property.
      Returns:
      the name of the property
      Since:
      1.0
      See Also:
    • setSubject

      public PropertyValidationRule setSubject(String subjectName)
      Set the subject that the property refers to.
      Parameters:
      subjectName - the subject name of the property
      Since:
      1.0
      See Also:
    • getSubject

      public String getSubject()
      Retrieves the subject name of the property.
      Specified by:
      getSubject in interface ValidationRule
      Overrides:
      getSubject in class AbstractValidationRule
      Returns:
      the subject name of the property
      Since:
      1.0
      See Also:
    • setLoadingErrors

      protected void setLoadingErrors(Collection<String> errors)
      Set the list of error messages that occurred during the loading of content data.
      Parameters:
      errors - the collection of errors messages
      Since:
      1.0
    • getLoadingErrors

      public Collection<String> getLoadingErrors()
      Retrieves the list of error messages that occurred during the loading of content data.
      Returns:
      the collection of errors messages; or

      null if the data was null or the property didn't exist

      Since:
      1.0