commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rdon...@apache.org
Subject cvs commit: jakarta-commons/beanutils/optional/bean-collections/src/java/org/apache/commons/beanutils BeanPredicate.java
Date Wed, 26 May 2004 21:49:06 GMT
rdonkin     2004/05/26 14:49:06

  Modified:    beanutils/optional/bean-collections/src/java/org/apache/commons/beanutils
                        BeanPredicate.java
  Log:
  JavaDoc'd BeanPredicate
  
  Revision  Changes    Path
  1.2       +41 -1     jakarta-commons/beanutils/optional/bean-collections/src/java/org/apache/commons/beanutils/BeanPredicate.java
  
  Index: BeanPredicate.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/beanutils/optional/bean-collections/src/java/org/apache/commons/beanutils/BeanPredicate.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- BeanPredicate.java	10 May 2004 19:58:15 -0000	1.1
  +++ BeanPredicate.java	26 May 2004 21:49:06 -0000	1.2
  @@ -22,18 +22,38 @@
   
   import java.lang.reflect.InvocationTargetException;
   
  +/**
  + * <p>Predicate implementation that applies the given <code>Predicate</code>
  + * to the result of calling the given property getter.
  + * </p>
  + */
   public class BeanPredicate implements Predicate {
      
       private final Log log = LogFactory.getLog(this.getClass());
  -
  +    
  +    /** Name of the property whose value will be predicated */
       private String propertyName;
  +    /** <code>Predicate</code> to be applied to the property value */
       private Predicate predicate;
   
  +    /**
  +     * Constructs a <code>BeanPredicate</code> that applies the given
  +     * <code>Predicate</code> to the named property value.
  +     * @param propertyName the name of the property whose value is to be predicated,
  +     * not null
  +     * @param predicate the <code>Predicate</code> to be applied,
  +     * not null
  +     */
       public BeanPredicate(String propertyName, Predicate predicate) {
           this.propertyName = propertyName;
           this.predicate = predicate;
       }
   
  +    /**
  +     * Evaluates the given object by applying the {@link #getPredicate()}
  +     * to a property value named by {@link #getPropertyName()}.
  +     * @throws IllegalAccessException when the property cannot be evaluated
  +     */
       public boolean evaluate(Object object) {
          
           boolean evaluation = false;
  @@ -62,18 +82,38 @@
           return evaluation;
       }
   
  +    /**
  +     * Gets the name of the property whose value is to be predicated.
  +     * in the evaluation.
  +     * @return the property name, not null
  +     */ 
       public String getPropertyName() {
           return propertyName;
       }
   
  +    /** 
  +     * Sets the name of the property whose value is to be predicated.
  +     * @param propertyName the name of the property whose value is to be predicated,
  +     * not null
  +     */
       public void setPropertyName(String propertyName) {
           this.propertyName = propertyName;
       }
   
  +    /**
  +     * Gets the <code>Predicate</code> to be applied to the value of the named
property
  +     * during {@link #evaluate}.
  +     * @return <code>Predicate</code>, not null
  +     */
       public Predicate getPredicate() {
           return predicate;
       }
   
  +    /** 
  +     * Sets the <code>Predicate</code> to be applied to the value of the named
property
  +     * during {@link evaluate}.
  +     * @param predicate <code>Predicate</code>, not null
  +     */
       public void setPredicate(Predicate predicate) {
           this.predicate = predicate;
       }
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message