KickJava   Java API By Example, From Geeks To Geeks.

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


1 /*
2  * Created on 2.2.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
10  * <code>net.mlw.vlh.adapter.jdbc.objectWrapper.DefaultWrapperAdapter</code>
11  * Using this wrapper you can replace record in valuelist with your record.
12  * Normally you select only ids and valulist is populated with the wrapped
13  * objects, that has selected id.
14  * <p>
15  * <li><em>
16  * Using wrappers is recommended in cases, when your hibernate hql is too complex, and you cannot controll all composite joins.
17  * Then you would appreciate jdbc with the cunjuction of wrappers that allow you to call third party managers, that return you wanted object.
18  * </em>
19  * </li>
20  * </p>
21  * <p>
22  * To pass additional parameters to the object wrapper, adapter will always set
23  * actuall ValueListInfo before calling <code>getWrappedRecord</code> method.
24  * </p>
25  * <p>
26  * The ObjectToBeWrapped is determined in adapter. It this time it could be a <code>ResultSet</code> or <b>one column</b> of the record.
27  * </p>
28  * @see net.mlw.vlh.adapter.jdbc.objectWrapper.DefaultWrapperAdapter#setWrapper(ObjectWrapper)
29  * @see net.mlw.vlh.adapter.jdbc.objectWrapper.DefaultWrapperAdapter
30  * @see net.mlw.vlh.adapter.util.ObjectValidator
31  *
32  * @author Andrej Zachar
33  * @version $Revision: 1.4 $ $Date: 2005/04/01 09:15:22 $
34  */

35 public interface ObjectWrapper {
36     /**
37      * This method wrap passed record,the type of this record you can specify in adpater's settings.
38      * Default adapter that use this interface is <code>net.mlw.vlh.adapter.jdbc.objectWrapper.DefaultWrapperAdapter</code>
39      * @param objectToBeWrapped represent original object
40      * <ol>
41      * It could be a
42      * <li>whole <code>ResultSet</code></li>
43      * or
44      * <li><b>one column</b> of the record from the ResultSet.</li>
45      * </ol>
46      * @return object that represent the final "substituted" record in your
47      * valuelist.
48      * @see net.mlw.vlh.adapter.jdbc.objectWrapper.DefaultWrapperAdapter#setWrapResultSet(boolean)
49      */

50     public Object JavaDoc getWrappedRecord(Object JavaDoc objectToBeWrapped);
51
52     /**
53      * @param info ValueListInfo used to pass additional parameter to the
54      * wrapper from your controler.
55      */

56     public void setValueListInfo(ValueListInfo info);
57 }
Popular Tags