KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > net > mlw > vlh > adapter > util > ObjectValidator


1 /*
2  * Created on 28.1.2005 azachar
3  */

4 package net.mlw.vlh.adapter.util;
5
6 import net.mlw.vlh.ValueListInfo;
7
8 /**
9  * This class is used in <code>ScrollableResultsDecorator</code> and
10  * <code>ResultSetDecorator</code>. Using this validator you can enable or
11  * disable putting objects into the final ResultsSet, thus into your final
12  * valueList.
13  * <p>
14  * <li>
15  * <em>Using validators is recommended in the case when you cannot do a filtering
16  * in database tier, otherwise validators may greatly slow down a performance because it's
17  * done in JVM.</em>
18  * </li>
19  * </p>
20  *
21  * @see net.mlw.vlh.adapter.jdbc.AbstractJdbcAdapter#setValidator(ObjectValidator)
22  * @see net.mlw.vlh.adapter.hibernate.Hibernate20Adapter#setValidator(ObjectValidator)
23  * @see net.mlw.vlh.adapter.jdbc.objectWrapper.DefaultWrapperAdapter#setWrapper(ObjectWrapper)
24  * @see net.mlw.vlh.adapter.hibernate.Hibernate20Adapter#setFocusOptimalization(boolean)
25  *
26  * @author Andrej Zachar
27  * @version $Revision: 1.3 $ $Date: 2005/02/23 13:54:14 $
28  */

29 public interface ObjectValidator
30 {
31     /**
32      *
33      * @param objectToBeChecked
34      * @return true if the given object is accepted at the final valueList.
35      * false if the given object is rejected from the final valueList.
36      */

37     public boolean isAcceptable(Object JavaDoc objectToBeChecked);
38
39     /**
40      * Adapter will set ValueListInfo before use. This interface allow you to
41      * "send" some additional date that could be helpfull in "acceptable
42      * process".
43      *
44      * @param info
45      */

46     public void setValueListInfo(ValueListInfo info);
47 }
48
Popular Tags