SRJRCFrames
v0.1.296

de.schwarzrot.bean.support
Class AbstractPropertyCondition<B>

java.lang.Object
  extended by de.schwarzrot.bean.support.AbstractPropertyCondition<B>
Type Parameters:
B - type of the bean
All Implemented Interfaces:
PropertyCondition<B>
Direct Known Subclasses:
AndPropertyCondition, IsFalsePropertyCondition, IsTruePropertyCondition, OrPropertyCondition

public abstract class AbstractPropertyCondition<B>
extends Object
implements PropertyCondition<B>

baseclass for conditions based on bean properties with late value fetching.

A condition is build by the class implementation, bean and property name. The value of the property may be undefined at the time of creating the condition instance. It will be fetched each time, the condition gets evaluated.

Author:
Reinhard Mantey

Constructor Summary
protected AbstractPropertyCondition(B aBean, String propertyName)
           
 
Method Summary
 B getBean()
          returns the bean of this condition
 Object getValue()
          accessor to beans property values.
protected  Object getValue(String propertyName)
          accessor to beans property values.
abstract  boolean matches()
          returns whether the current condition matches.
 void setBean(B bean)
          sets the bean of this condition
 void setPropertyName(String propertyName)
          sets the name of the property that will be evaluated
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractPropertyCondition

protected AbstractPropertyCondition(B aBean,
                                    String propertyName)
Method Detail

getBean

public final B getBean()
returns the bean of this condition

Returns:
- the bean to evaluate

getValue

public final Object getValue()
accessor to beans property values. Uses the property name, that has been plugged at instance creation

Returns:
- a value hold by a beans property

matches

public abstract boolean matches()
Description copied from interface: PropertyCondition
returns whether the current condition matches.

Specified by:
matches in interface PropertyCondition<B>
Returns:
- true, if the implemented condition is met, otherwise false

setBean

public final void setBean(B bean)
sets the bean of this condition

Parameters:
bean - - the bean to evaluate

setPropertyName

public final void setPropertyName(String propertyName)
sets the name of the property that will be evaluated

Parameters:
propertyName - - the name of a property

getValue

protected Object getValue(String propertyName)
accessor to beans property values. Uses given property name. This call is used by implementing classes to access values from other properties

Parameters:
propertyName - - the name of the property to access
Returns:
- the value held by given property

SRJRCFrames
v0.1.296

hosted at
Find SRJRCFrames at SourceForge.net. Fast, secure and free:
           Open Source Software download
Submit a bug or request a feature

SRJRCFrames is published according to the GNU General Public License
Copyright 2005-2012 Reinhard Mantey - some rights reserved.