KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > beehive > controls > system > jdbc > DefaultIteratorResultSetMapper


1 /*
2  * Copyright 2005 The Apache Software Foundation.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  *
16  * $Header:$
17  */

18
19 package org.apache.beehive.controls.system.jdbc;
20
21 import org.apache.beehive.controls.api.context.ControlBeanContext;
22
23 import java.lang.reflect.Method JavaDoc;
24 import java.sql.ResultSet JavaDoc;
25 import java.util.Calendar JavaDoc;
26 import java.util.Iterator JavaDoc;
27
28 /**
29  * Default ResultSetMapper implementation for Iterators.
30  */

31 public class DefaultIteratorResultSetMapper extends ResultSetMapper {
32
33     /**
34      * Map a ResultSet to an object type
35      * Type of object to interate over is defined in the SQL annotation for the method.
36      *
37      * @param context A ControlBeanContext instance, see Beehive controls javadoc for additional information
38      * @param m Method assoicated with this call.
39      * @param resultSet Result set to map.
40      * @param cal A Calendar instance for time/date value resolution.
41      * @return The Iterator object instance resulting from the ResultSet
42      */

43     public Iterator JavaDoc mapToResultType(ControlBeanContext context, Method JavaDoc m, ResultSet JavaDoc resultSet, Calendar JavaDoc cal) {
44         return new ResultSetIterator(context, m, resultSet, cal);
45     }
46
47     /**
48      * Can the ResultSet which this mapper uses be closed by the database control on return from its invoke() method?
49      * @return always returns false
50      */

51     public boolean canCloseResultSet() { return false; }
52 }
53
Popular Tags