KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > jorm > metainfo > api > NameRef


1 /**
2  * JORM: an implementation of a generic mapping system for persistent Java
3  * objects. Two mapping are supported: to RDBMS and to binary files.
4  * Copyright (C) 2001-2003 France Telecom R&D - INRIA
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2 of the License, or (at your option) any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with this library; if not, write to the Free Software
18  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19  *
20  * Contact: jorm-team@objectweb.org
21  *
22  */

23
24 package org.objectweb.jorm.metainfo.api;
25
26 import java.util.Map JavaDoc;
27
28 /**
29  * The NameRef interface defines methods to manage reference to composite name.
30  * NameRef are used in namedef to reference a composite name that describe the structure of the namedef.
31  * @author N. De Palma
32  */

33 public interface NameRef extends MetaObject {
34     /**
35      * Add a projection between a field in the composite name structure and a field in the class.
36      * @param namefield the name of the field in the composite name
37      * @param classfield the name of the field in the class
38      */

39     void addProjection(String JavaDoc namefield, String JavaDoc classfield);
40
41     /**
42      * Retrieve the list of projections between the fields of the composite name and the field of the class.
43      * @return a map object describing the projection.
44      */

45     Map JavaDoc getProjection();
46
47     /**
48      * Return the class field name associated with the composite name field name.
49      * @param fieldName the name of a field in the composite name.
50      * @return a String object containing a class field name.
51      */

52     String JavaDoc getClassFieldName(String JavaDoc fieldName);
53
54     /**
55      * Retrieve the name of the nameref. This name is equal to the name of the referenced composite name.
56      * @return the nameof the nameref used to describe the current pname.
57      */

58     String JavaDoc getName();
59
60     /**
61      * Retrieve the metaobject describing the composite name referenced by this nameref.
62      * @return the composite name.
63      */

64     CompositeName getCompositeName();
65
66     /**
67      * test if the type of the compositename referenced in this nameref is equals to the type
68      * referenced by the nameref passed as parameter.
69      * @param obj the nameref to compare to
70      * @return true if the schema name ans the compositename name are equal.
71      */

72     boolean equalCNType(Object JavaDoc obj);
73
74     /**
75      * Return the name of the schema for the composite name referenced by this nameref.
76      */

77     String JavaDoc getCNPackageName();
78 }
79
Popular Tags