org.nakedobjects.metamodel.facets.properties.validate.PropertyValidateFacet Maven / Gradle / Ivy
package org.nakedobjects.metamodel.facets.properties.validate;
import org.nakedobjects.metamodel.adapter.NakedObject;
import org.nakedobjects.metamodel.facets.Facet;
import org.nakedobjects.metamodel.facets.properties.modify.PropertySetterFacet;
import org.nakedobjects.metamodel.facets.properties.modify.PropertySetterFacetAbstract;
import org.nakedobjects.metamodel.interactions.ValidatingInteractionAdvisor;
/**
* The mechanism by which the proposed value of a property can be validated, called immediately before
* {@link PropertySetterFacetAbstract setting the value}.
*
*
* In the standard Naked Objects Programming Model, corresponds to invoking the validateXxx method
* for a property with an accessor of getXxx.
*
* @see PropertySetterFacet
*/
public interface PropertyValidateFacet extends Facet, ValidatingInteractionAdvisor {
/**
* The reason why the proposed value is invalid.
*
*
* Should return null if the value is in fact valid.
*/
public String invalidReason(NakedObject targetObject, NakedObject proposedValue);
}