KickJava   Java API By Example, From Geeks To Geeks.

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


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.Iterator JavaDoc;
27
28 /**
29  * A PrimitiveElement is a field with a primitive type. Type can be
30  * boolean | byte | char | short | int | long | float | double |
31  * string | serialized| date | time | timestamp
32  * A primitive type can not be extended.
33  * @author X. Spengler
34  */

35 public interface PrimitiveElement extends TypedElement {
36
37     int CONSTANT_PERSISTENT = 2;
38     int CONSTANT_NON_PERSISTENT = 3;
39     int VARIABLE_PERSISTENT = 1;
40
41     /**
42      * Allows to know if the current Field is a scalar field or not.
43      *
44      * @return true, if the Field is scalar, else false, if the Field is not
45      * scalar
46      */

47     boolean isScalar();
48
49     /**
50      * Returns the size of the field in case of string, serialized, arrays,
51      * bigdecimal, etc
52      * @return the size for this type
53      */

54     int getSize();
55
56     int getScale();
57
58     /**
59      * Gets the status wrt constance and persistence.
60      * @see this.setStatus()
61      */

62     int getStatus();
63
64     /**
65      * Assigns the status indicating if the primitive element is one of:
66      * <ul><li>variable and persistent (classical case)</li>
67      * <li>constant and persistent</li>
68      * <li>constant and not persistent</li>
69      * </ul>
70      */

71     void setStatus(int status);
72
73     /**
74      * @return true if the field is constant
75      */

76     boolean isConstant();
77
78     /**
79      * @return true if the field is persistent
80      */

81     boolean isPersistent();
82
83     /**
84      * Indicate if the primitive element is auto calculated. In case of a
85      * CompositeName, an auto calculated field means that the value is
86      * calculated by an external tool. In case of a class, an auto calculated
87      * field means that the value is calculated by the data support (auto
88      * increment value for instance).
89      */

90     boolean isAutoCalculated();
91
92     /**
93      *
94      * @see this.isAutoCalculated()
95      */

96     void setIsAutoCalculated(boolean autocalculated);
97 }
98
Popular Tags