org.springframework.rules.constraint.property
Class AbstractPropertyConstraint

java.lang.Object
  extended by org.springframework.rules.constraint.property.AbstractPropertyConstraint
All Implemented Interfaces:
Constraint, PropertyConstraint
Direct Known Subclasses:
ConditionalPropertyConstraint, PropertiesConstraint, PropertyInGroupConstraint, PropertyPresent, PropertyValueConstraint, RequiredIfTrue

public abstract class AbstractPropertyConstraint
extends Object
implements PropertyConstraint

Convenience superclass for bean property expressions.

Author:
Keith Donald

Constructor Summary
protected AbstractPropertyConstraint()
           
protected AbstractPropertyConstraint(String propertyName)
           
 
Method Summary
 String getPropertyName()
          Returns the constrained property name.
 boolean isCompoundRule()
          Does this property constraint effect more than one property?
 boolean isDependentOn(String propertyName)
          Returns true if this property constraint is dependent on the provided propertyName for test evaluation; that is, it should be retested when propertyName changes.
protected  void setPropertyName(String propertyName)
           
 boolean test(Object o)
          Test the provided argument against this predicate's condition.
protected abstract  boolean test(PropertyAccessStrategy domainObjectAccessStrategy)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AbstractPropertyConstraint

protected AbstractPropertyConstraint()

AbstractPropertyConstraint

protected AbstractPropertyConstraint(String propertyName)
Method Detail

getPropertyName

public String getPropertyName()
Description copied from interface: PropertyConstraint
Returns the constrained property name.

Specified by:
getPropertyName in interface PropertyConstraint
Returns:
The property name

isDependentOn

public boolean isDependentOn(String propertyName)
Description copied from interface: PropertyConstraint
Returns true if this property constraint is dependent on the provided propertyName for test evaluation; that is, it should be retested when propertyName changes.

Specified by:
isDependentOn in interface PropertyConstraint
Returns:
true or false

isCompoundRule

public boolean isCompoundRule()
Description copied from interface: PropertyConstraint
Does this property constraint effect more than one property?

Specified by:
isCompoundRule in interface PropertyConstraint
Returns:
true if yes, false otherwise

setPropertyName

protected void setPropertyName(String propertyName)

test

public boolean test(Object o)
Description copied from interface: Constraint
Test the provided argument against this predicate's condition.

Specified by:
test in interface Constraint
Parameters:
o - the argument value
Returns:
true if the condition was satisfied, false otherwise

test

protected abstract boolean test(PropertyAccessStrategy domainObjectAccessStrategy)

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2004-2008 The Spring Framework. All Rights Reserved.