KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > xquark > mapping > Generator


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 package org.xquark.mapping;
24
25 /** Object that provide the value to store in a column
26  *
27  */

28 public interface Generator
29 {
30     /**
31      * This method is called by the XQuark storage engine when a user-generated
32      * column of a relational table is filled. The Object type returned must be
33      * consistent with the type returned by the XQuark schema API as defined in
34      * the following table:
35      * <table>
36      * <tr><th>XML schema base built-in primitive type</th><th>Java class</th></tr>
37      * <tr><td>string</td><td>{@link String}</td></tr>
38      * <tr><td>boolean</td><td>{@link Boolean}</td></tr>
39      * <tr><td>decimal</td><td>{@link java.math.BigDecimal} or {@link Long} if type facet ensure it fits.</td></tr>
40      * <tr><td>float</td><td>{@link Float}</td></tr>
41      * <tr><td>double</td><td>{@link Double}</td></tr>
42      * <tr><td>QName</td><td>{@link org.xquark.schema.datatypes.QName}</td></tr>
43      * <tr><td>NOTATION</td><td>{@link org.xquark.schema.datatypes.QName}</td></tr>
44      * <tr><td>duration</td><td>{@link org.xquark.schema.datatypes.Duration}</td></tr>
45      * <tr><td>dateTime</td><td>{@link org.xquark.schema.datatypes.DateTime}</td></tr>
46      * <tr><td>time</td><td>{@link org.xquark.schema.datatypes.DateTime}</td></tr>
47      * <tr><td>date</td><td>{@link org.xquark.schema.datatypes.DateTime}</td></tr>
48      * <tr><td>gYearMonth</td><td>{@link org.xquark.schema.datatypes.DateTime}</td></tr>
49      * <tr><td>gYear</td><td>{@link org.xquark.schema.datatypes.DateTime}</td></tr>
50      * <tr><td>gMonthDay</td><td>{@link org.xquark.schema.datatypes.DateTime}</td></tr>
51      * <tr><td>gDay</td><td>{@link org.xquark.schema.datatypes.DateTime}</td></tr>
52      * <tr><td>gMonth</td><td>{@link org.xquark.schema.datatypes.DateTime}</td></tr>
53      * <tr><td>hexBinary</td><td>{@link org.xquark.schema.datatypes.ByteArray}</td></tr>
54      * <tr><td>base64Binary</td><td>{@link org.xquark.schema.datatypes.ByteArray}</td></tr>
55      * <tr><td>anyURI</td><td>{@link org.xquark.schema.datatypes.URI}</td></tr>
56      * <tr><td>union</td><td>not supported</td></tr>
57      * <tr><td>list</td><td>{@link java.util.List}</td></tr>
58      * <tr><td>anySimpleType</td><td>{@link String}</td></tr>
59      * </table>
60      * @param context Passed by the mapping algorithm to provide an access
61      * to storage system variables.
62      * @return An Object, that must be consistent with the type returned by the XQuark
63      * schema API.
64      */

65     Object JavaDoc getValue(StorageContext context);
66 }
67
Popular Tags