KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > xquark > mapper > metadata > StoragePathMetadata


1 /*
2  * This file belongs to the XQuark distribution.
3  * Copyright (C) 2003 Universite de Versailles Saint-Quentin.
4  *
5  * This program is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Lesser General Public
7  * License as published by the Free Software Foundation; either
8  * version 2.1 of the License, or (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13  * Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public
16  * License along with this program; if not, write to the Free Software
17  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307.
18  * You can also get it at http://www.gnu.org/licenses/lgpl.html
19  *
20  * For more information on this software, see http://www.xquark.org.
21  */

22
23 /*
24  * PathMetadata.java
25  *
26  * Created on 18 septembre 2001, 18:11
27  */

28 package org.xquark.mapper.metadata;
29
30 import java.util.List JavaDoc;
31
32 import org.xquark.mapper.mapping.ColumnMapping;
33 import org.xquark.schema.Declaration;
34
35 /**
36  * Common interface for XML storage to metadata for a particular
37  * path. Should be used both by both Repository and Mapper.
38  *
39  */

40 public interface StoragePathMetadata
41 {
42
43     /** Unknow mode */
44     byte UNKNOWN = 0x0;
45     /** no OID allocated (discarded from the storage model) */
46     byte DISCARDED = 0x1;
47     /** struct tuple may be present or not (Mixed with optional subelements or
48      * no schema): TO DO mettre a jour dynamiquement pour chemins sans schema (assurer la persistence dans path set)
49      */

50     byte POTENTIAL_STRUCT = 0x2;
51     /** struct tuple present and no data tuple
52      */

53     byte STRUCT_ONLY = 0x4;
54     /** data tuple present and no range tuple
55      */

56     byte DATA_ONLY = 0x8;
57     /** struct and data tuple present
58      */

59     byte DATA_AND_STRUCT = 0x10;
60
61     /** Indicate the storage mode of the node, i.e., if the node is
62      * stored and where it is stored.
63      * @return a constant for all possible storage scheme
64      * @see #DISCARDED
65      * @see #POTENTIAL_STRUCT
66      * @see #STRUCT_ONLY
67      * @see #DATA_ONLY
68      * @see #DATA_AND_STRUCT
69      */

70     byte getStorageMode();
71
72     /** Indicate if an element can ne xsi:nil even if no extra-nil info is
73      * available.
74      * @return if True, when there is a possible confusion beetween
75      * missing and nil (in fact null column case), then the element is nil.
76      */

77     boolean isNilImplicit();
78
79     /**
80       * Get the column mapping defined on this path used for reconstruction
81       * or querying.
82       * @return the reference {@link ColumnMapping org.xquark.mapper.mapping.ColumnMapping} object
83       * @see org.xquark.mapper.mapping.ColumnMapping
84       */

85     // TO DO : when multiple column mappings exist on a declaration add an attribute to
86
// mapping language to let the user specify it
87
ColumnMapping getReferenceColumnMapping();
88     // take first in the list (in a 1st step)
89

90     /**
91     * Get the table mappings defined on this path.
92     * @return a list of table mappings
93     * @see org.xquark.mapper.mapping.TableMapping
94     */

95     List JavaDoc getTableMappings();
96
97     /**
98      * Get the column mappings defined on this path.
99      * @return a list of column mappings
100      * @see org.xquark.mapper.mapping.ColumnMapping
101      */

102     List JavaDoc getColumnMappings();
103
104     /** Get the unique identifier for a path in an XMLCollection.
105      * @return a short identifier <B>that must be used for node comparison</B>
106      */

107     short getPathID();
108
109     /** Flag to indicate if the node has been stored and an OID allocated.
110      * <p>i.e., getStorageMode() != DISCARDED</p>
111      * @return true if an OID exists for the node
112      */

113     boolean isPersistent();
114
115     /** Indicate if the position of the node iwithin its siblings is enforced
116      * by schema information.
117      * @return True if positon of the node can be enforced by schema information.
118      */

119     boolean isPositionEnforced();
120
121     /** Returns the XML schema component for this node.
122      * <p>Allows to access declarations info like nillable, minOccurs...</p>
123      * @return The schema component corresponding to the path if any.
124      * Null else.
125      */

126     Declaration getDeclaration();
127
128     /**
129      * Returns the XPath model node type.
130      * @return an integer constant defined in {@link org.xquark.xml.xpath.Type}
131      */

132     public byte getType();
133     
134     /**
135      * Returns the namespace of the metadata node.
136      * @return the namespace URI
137      * @see org.xquark.xml.xpath.XTreeNode
138      */

139     public String JavaDoc getNamespace();
140     
141     /**
142      * Returns the local name of the metadata node.
143      * @return the local name
144      * @see org.xquark.xml.xpath.XTreeNode
145      */

146     public String JavaDoc getLocalName();
147     
148     /**
149      * Whether, according to the XML schema type of the metadata node, the
150      * default mapping (not planned by user using mapping language) is authorized
151      * for the path.
152      * @return boolean
153      */

154     public boolean isDefaultAllowed();
155 }
156
Popular Tags