KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > oracle > toplink > essentials > mappings > ContainerMapping


1 /*
2  * The contents of this file are subject to the terms
3  * of the Common Development and Distribution License
4  * (the "License"). You may not use this file except
5  * in compliance with the License.
6  *
7  * You can obtain a copy of the license at
8  * glassfish/bootstrap/legal/CDDLv1.0.txt or
9  * https://glassfish.dev.java.net/public/CDDLv1.0.html.
10  * See the License for the specific language governing
11  * permissions and limitations under the License.
12  *
13  * When distributing Covered Code, include this CDDL
14  * HEADER in each file and include the License file at
15  * glassfish/bootstrap/legal/CDDLv1.0.txt. If applicable,
16  * add the following below this CDDL HEADER, with the
17  * fields enclosed by brackets "[]" replaced with your
18  * own identifying information: Portions Copyright [yyyy]
19  * [name of copyright owner]
20  */

21 // Copyright (c) 1998, 2005, Oracle. All rights reserved.
22
package oracle.toplink.essentials.mappings;
23
24 import oracle.toplink.essentials.internal.queryframework.*;
25
26 /**
27  * Interface used by clients to interact
28  * with the assorted mappings that use <code>ContainerPolicy</code>.
29  *
30  * @see oracle.toplink.essentials.internal.queryframework.ContainerPolicy
31  *
32  * @author Big Country
33  * @since TOPLink/Java 4.0
34  */

35 public interface ContainerMapping {
36
37     /**
38      * PUBLIC:
39      * Return the mapping's container policy.
40      */

41     ContainerPolicy getContainerPolicy();
42
43     /**
44      * PUBLIC:
45      * Set the mapping's container policy.
46      */

47     void setContainerPolicy(ContainerPolicy containerPolicy);
48
49     /**
50      * PUBLIC:
51      * Configure the mapping to use an instance of the specified container class
52      * to hold the target objects.
53      * <p>The container class must implement (directly or indirectly) the
54      * <code>java.util.Collection</code> interface.
55      */

56     void useCollectionClass(Class JavaDoc concreteClass);
57
58     /**
59      * PUBLIC:
60      * Configure the mapping to use an instance of the specified container class
61      * to hold the target objects. The key used to index a value in the
62      * <code>Map</code> is the value returned by a call to the specified
63      * zero-argument method.
64      * The method must be implemented by the class (or a superclass) of any
65      * value to be inserted into the <code>Map</code>.
66      * <p>The container class must implement (directly or indirectly) the
67      * <code>java.util.Map</code> interface.
68      * <p>To facilitate resolving the method, the mapping's referenceClass
69      * must set before calling this method.
70      */

71     void useMapClass(Class JavaDoc concreteClass, String JavaDoc methodName);
72 }
73
Popular Tags