
org.beanfabrics.validation.Validatable Maven / Gradle / Ivy
Show all versions of beanfabrics-core Show documentation
/*
* Beanfabrics Framework Copyright (C) by Michael Karneim, beanfabrics.org
* Use is subject to license terms. See license.txt.
*/
package org.beanfabrics.validation;
/**
* The Validatable
interface declares the interface for classes
* that can be validated.
*
* See the online
* documentation on validation for more information.
*
* @author Michael Karneim
*/
public interface Validatable {
/**
* Updates the validation state of this object, usually by calling
* {@link Validator#validate()}.
*/
public void revalidate();
/**
* Returns the current validation state of this object.
*
* @return the current validation state of this object
*/
public ValidationState getValidationState();
/**
* Returns whether this object is valid. This object is valid if its
* validation state is null
.
*
* @return true
if this object is valid, otherwise
* false
.
*/
public boolean isValid();
/**
* Returns the {@link Validator} of this object. The validator is
* responsible for creating the {@link ValidationState} of this object by
* evaluating a specific set of {@link ValidationRule}s.
*
* @return the Validator
of this object
*/
public Validator getValidator();
}